| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
|
| 11 | |
|
| 12 | |
|
| 13 | |
|
| 14 | |
|
| 15 | |
|
| 16 | |
package javax.faces.model; |
| 17 | |
|
| 18 | |
import java.io.Serializable; |
| 19 | |
|
| 20 | |
import org.seasar.framework.util.AssertionUtil; |
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
|
| 26 | |
public class SelectItem implements Serializable { |
| 27 | |
|
| 28 | |
private static final long serialVersionUID = 1L; |
| 29 | |
|
| 30 | 229 | private Object value = null; |
| 31 | |
|
| 32 | 229 | private String label = null; |
| 33 | |
|
| 34 | 229 | private String description = null; |
| 35 | |
|
| 36 | 229 | private boolean disabled = false; |
| 37 | |
|
| 38 | 179 | public SelectItem() { |
| 39 | 179 | } |
| 40 | |
|
| 41 | 1 | public SelectItem(Object value) { |
| 42 | 1 | AssertionUtil.assertNotNull("value", value); |
| 43 | 0 | this.value = value; |
| 44 | 0 | this.label = value.toString(); |
| 45 | 0 | this.description = null; |
| 46 | 0 | this.disabled = false; |
| 47 | 0 | } |
| 48 | |
|
| 49 | |
public SelectItem(Object value, String label) { |
| 50 | 24 | this(value, label, null); |
| 51 | 21 | } |
| 52 | |
|
| 53 | |
public SelectItem(Object value, String label, String description) { |
| 54 | 33 | this(value, label, description, false); |
| 55 | 28 | } |
| 56 | |
|
| 57 | |
public SelectItem(Object value, String label, String description, |
| 58 | 49 | boolean disabled) { |
| 59 | 49 | AssertionUtil.assertNotNull("value", value); |
| 60 | 46 | AssertionUtil.assertNotNull("label", label); |
| 61 | 41 | this.value = value; |
| 62 | 41 | this.label = label; |
| 63 | 41 | this.description = description; |
| 64 | 41 | this.disabled = disabled; |
| 65 | 41 | } |
| 66 | |
|
| 67 | |
public String getDescription() { |
| 68 | 11 | return description; |
| 69 | |
} |
| 70 | |
|
| 71 | |
public void setDescription(String description) { |
| 72 | 171 | this.description = description; |
| 73 | 171 | } |
| 74 | |
|
| 75 | |
public boolean isDisabled() { |
| 76 | 214 | return disabled; |
| 77 | |
} |
| 78 | |
|
| 79 | |
public void setDisabled(boolean disabled) { |
| 80 | 169 | this.disabled = disabled; |
| 81 | 169 | } |
| 82 | |
|
| 83 | |
public String getLabel() { |
| 84 | 154 | return label; |
| 85 | |
} |
| 86 | |
|
| 87 | |
public void setLabel(String label) { |
| 88 | 173 | AssertionUtil.assertNotNull("label", label); |
| 89 | 172 | this.label = label; |
| 90 | 172 | } |
| 91 | |
|
| 92 | |
public Object getValue() { |
| 93 | 169 | return value; |
| 94 | |
} |
| 95 | |
|
| 96 | |
public void setValue(Object value) { |
| 97 | 174 | AssertionUtil.assertNotNull("value", value); |
| 98 | 173 | this.value = value; |
| 99 | 173 | } |
| 100 | |
|
| 101 | |
} |