1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
|
18 | |
|
19 | |
package javax.faces.component; |
20 | |
|
21 | |
import javax.el.ValueExpression; |
22 | |
import javax.faces.context.FacesContext; |
23 | |
import javax.faces.component.UIComponent; |
24 | |
|
25 | |
|
26 | |
|
27 | |
|
28 | |
|
29 | |
|
30 | |
public class UISelectItem extends javax.faces.component.UIComponentBase |
31 | |
{ |
32 | |
|
33 | |
static public final String COMPONENT_FAMILY = |
34 | |
"javax.faces.SelectItem"; |
35 | |
static public final String COMPONENT_TYPE = |
36 | |
"javax.faces.SelectItem"; |
37 | |
|
38 | |
|
39 | |
public void setRendered(boolean state) |
40 | |
{ |
41 | 0 | super.setRendered(state); |
42 | |
|
43 | |
|
44 | 0 | } |
45 | |
|
46 | |
protected javax.faces.context.FacesContext getFacesContext() |
47 | |
{ |
48 | |
|
49 | |
|
50 | |
|
51 | |
|
52 | |
|
53 | 0 | UIComponent parent = getParent(); |
54 | 0 | if (parent != null && parent.isCachedFacesContext()) |
55 | |
{ |
56 | 0 | return parent.getFacesContext(); |
57 | |
} |
58 | |
else |
59 | |
{ |
60 | 0 | return super.getFacesContext(); |
61 | |
} |
62 | |
} |
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | |
public UISelectItem() |
68 | 92 | { |
69 | 92 | setRendererType(null); |
70 | 92 | } |
71 | |
|
72 | |
@Override |
73 | |
public String getFamily() |
74 | |
{ |
75 | 0 | return COMPONENT_FAMILY; |
76 | |
} |
77 | |
|
78 | |
|
79 | |
|
80 | |
|
81 | |
|
82 | |
|
83 | |
public Object getValue() |
84 | |
{ |
85 | 72 | return getStateHelper().eval(PropertyKeys.value); |
86 | |
} |
87 | |
|
88 | |
public void setValue(Object value) |
89 | |
{ |
90 | 0 | getStateHelper().put(PropertyKeys.value, value ); |
91 | 0 | } |
92 | |
|
93 | |
|
94 | |
public boolean isItemDisabled() |
95 | |
{ |
96 | 72 | return (Boolean) getStateHelper().eval(PropertyKeys.itemDisabled, false); |
97 | |
} |
98 | |
|
99 | |
public void setItemDisabled(boolean itemDisabled) |
100 | |
{ |
101 | 0 | getStateHelper().put(PropertyKeys.itemDisabled, itemDisabled ); |
102 | 0 | } |
103 | |
|
104 | |
|
105 | |
public boolean isItemEscaped() |
106 | |
{ |
107 | 72 | return (Boolean) getStateHelper().eval(PropertyKeys.itemEscaped, true); |
108 | |
} |
109 | |
|
110 | |
public void setItemEscaped(boolean itemEscaped) |
111 | |
{ |
112 | 0 | getStateHelper().put(PropertyKeys.itemEscaped, itemEscaped ); |
113 | 0 | } |
114 | |
|
115 | |
|
116 | |
public String getItemDescription() |
117 | |
{ |
118 | 72 | return (String) getStateHelper().eval(PropertyKeys.itemDescription); |
119 | |
} |
120 | |
|
121 | |
public void setItemDescription(String itemDescription) |
122 | |
{ |
123 | 0 | getStateHelper().put(PropertyKeys.itemDescription, itemDescription ); |
124 | 0 | } |
125 | |
|
126 | |
|
127 | |
public String getItemLabel() |
128 | |
{ |
129 | 72 | return (String) getStateHelper().eval(PropertyKeys.itemLabel); |
130 | |
} |
131 | |
|
132 | |
public void setItemLabel(String itemLabel) |
133 | |
{ |
134 | 0 | getStateHelper().put(PropertyKeys.itemLabel, itemLabel ); |
135 | 0 | } |
136 | |
|
137 | |
|
138 | |
public Object getItemValue() |
139 | |
{ |
140 | 72 | return getStateHelper().eval(PropertyKeys.itemValue); |
141 | |
} |
142 | |
|
143 | |
public void setItemValue(Object itemValue) |
144 | |
{ |
145 | 108 | getStateHelper().put(PropertyKeys.itemValue, itemValue ); |
146 | 108 | } |
147 | |
|
148 | |
|
149 | |
public boolean isNoSelectionOption() |
150 | |
{ |
151 | 72 | return (Boolean) getStateHelper().eval(PropertyKeys.noSelectionOption, false); |
152 | |
} |
153 | |
|
154 | |
public void setNoSelectionOption(boolean noSelectionOption) |
155 | |
{ |
156 | 12 | getStateHelper().put(PropertyKeys.noSelectionOption, noSelectionOption ); |
157 | 12 | } |
158 | |
|
159 | |
|
160 | 16 | enum PropertyKeys |
161 | |
{ |
162 | 2 | value |
163 | 2 | , itemDisabled |
164 | 2 | , itemEscaped |
165 | 2 | , itemDescription |
166 | 2 | , itemLabel |
167 | 2 | , itemValue |
168 | 2 | , noSelectionOption |
169 | |
} |
170 | |
|
171 | |
} |