combolistvaluesbean.java

来自「IBM RSA下的JSF开发示例」· Java 代码 · 共 75 行

JAVA
75
字号
/* ComboListValuesBean.java
 * Created on Dec 16, 2004
 * 
 * A bean to store the current values.
 */
package com.ibm.samples.comboListBox;

/**
 * @author cmjaun
 */
public class ComboListValuesBean {
	private String color; // string to hold the value from the combo box
	private String[] shape; // an array of Strings to hold the value from the multi-select list box
	private String month; // a string to hold the value from the single-select list box
	
	private String selected;
	
	/**
	 * @return Returns the color.
	 */
	public String getColor() {
		return color;
	}
	/**
	 * @param color The color to set.
	 */
	public void setColor(String color) {
		this.color = color;
	}
	/**
	 * @return Returns the shape.
	 */
	public String[] getShape() {
		return shape;
	}
	/**
	 * @param shape The shape to set.
	 */
	public void setShape(String[] shape) {
		this.shape = shape;
	}
	/**
	 * @return Returns the month.
	 */
	public String getMonth() {
		if( month == null) {
			month = "Jan";
		}
		return month;
	}
	/**
	 * @param month The month to set.
	 */
	public void setMonth(String month) {
		this.month = month;
	}
	/**
	 * Returns the shape array as a String to display on page.
	 * 
	 * @return Returns the selected.
	 */
	public String getSelected() {
		if( shape != null ) {
			for( int i = 0; i < shape.length; i++ ) {
				if( i == 0 ) {
					selected = shape[i] + " ";
				} else {
					selected = selected + shape[i] + " ";
				}
			}
		}
		return selected;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?