1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package javax.faces.model; |
20 | |
|
21 | |
import java.io.Serializable; |
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
public class SelectItem implements Serializable |
30 | |
{ |
31 | |
private static final long serialVersionUID = 8841094741464512226L; |
32 | |
|
33 | |
private Object _value; |
34 | |
private String _label; |
35 | |
private String _description; |
36 | |
private boolean _disabled; |
37 | |
private boolean _escape; |
38 | |
|
39 | |
|
40 | |
public SelectItem() |
41 | 0 | { |
42 | 0 | } |
43 | |
|
44 | |
public SelectItem(Object value) |
45 | 0 | { |
46 | 0 | _value = value; |
47 | 0 | _label = value == null ? null : value.toString(); |
48 | 0 | _description = null; |
49 | 0 | _disabled = false; |
50 | 0 | _escape=true; |
51 | 0 | } |
52 | |
|
53 | |
public SelectItem(Object value, String label) |
54 | 0 | { |
55 | 0 | _value = value; |
56 | 0 | _label = label; |
57 | 0 | _description = null; |
58 | 0 | _disabled = false; |
59 | 0 | _escape = true; |
60 | 0 | } |
61 | |
|
62 | |
public SelectItem(Object value, String label, String description) |
63 | 0 | { |
64 | 0 | _value = value; |
65 | 0 | _label = label; |
66 | 0 | _description = description; |
67 | 0 | _disabled = false; |
68 | 0 | _escape = true; |
69 | 0 | } |
70 | |
|
71 | |
public SelectItem(Object value, String label, String description, boolean disabled) |
72 | 0 | { |
73 | 0 | _value = value; |
74 | 0 | _label = label; |
75 | 0 | _description = description; |
76 | 0 | _disabled = disabled; |
77 | 0 | _escape = true; |
78 | 0 | } |
79 | |
|
80 | |
public SelectItem(Object value, String label, String description, boolean disabled, boolean escape) |
81 | 0 | { |
82 | 0 | _value = value; |
83 | 0 | _label = label; |
84 | 0 | _description = description; |
85 | 0 | _disabled = disabled; |
86 | 0 | this._escape = escape; |
87 | 0 | } |
88 | |
|
89 | |
|
90 | |
public String getDescription() |
91 | |
{ |
92 | 0 | return _description; |
93 | |
} |
94 | |
|
95 | |
public void setDescription(String description) |
96 | |
{ |
97 | 0 | _description = description; |
98 | 0 | } |
99 | |
|
100 | |
public boolean isDisabled() |
101 | |
{ |
102 | 0 | return _disabled; |
103 | |
} |
104 | |
|
105 | |
public void setDisabled(boolean disabled) |
106 | |
{ |
107 | 0 | _disabled = disabled; |
108 | 0 | } |
109 | |
|
110 | |
public String getLabel() |
111 | |
{ |
112 | 0 | return _label; |
113 | |
} |
114 | |
|
115 | |
public void setLabel(String label) |
116 | |
{ |
117 | 0 | if (label == null) |
118 | 0 | throw new NullPointerException("label"); |
119 | 0 | _label = label; |
120 | 0 | } |
121 | |
|
122 | |
public Object getValue() |
123 | |
{ |
124 | 0 | return _value; |
125 | |
} |
126 | |
|
127 | |
public void setValue(Object value) |
128 | |
{ |
129 | 0 | _value = value; |
130 | 0 | } |
131 | |
|
132 | |
public boolean isEscape() |
133 | |
{ |
134 | 0 | return _escape; |
135 | |
} |
136 | |
|
137 | |
public void setEscape(boolean escape) |
138 | |
{ |
139 | 0 | this._escape = escape; |
140 | 0 | } |
141 | |
|
142 | |
} |