1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.apache.myfaces.tobago.component;
21
22 import javax.faces.context.FacesContext;
23 import org.apache.myfaces.tobago.context.Markup;
24 import org.apache.myfaces.tobago.internal.component.AbstractUISelectOneListbox;
25 import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26 import org.apache.myfaces.tobago.internal.util.ArrayUtils;
27 import org.apache.myfaces.tobago.internal.util.StringUtils;
28 import org.apache.myfaces.tobago.internal.util.Deprecation;
29 import org.apache.myfaces.tobago.component.Tags;
30 import javax.annotation.Generated;
31 import javax.el.ELException;
32 import javax.faces.FacesException;
33 import java.util.Arrays;
34 import java.util.ArrayList;
35 import java.util.Collection;
36 import java.util.List;
37 import javax.el.MethodExpression;
38 import javax.el.ValueExpression;
39
40
41
42
43
44
45 @Generated("component.stg")
46 public class UISelectOneListbox
47 extends AbstractUISelectOneListbox {
48
49 public static final String COMPONENT_TYPE = Tags.selectOneListbox.componentType();
50
51 public static final String COMPONENT_FAMILY = "javax.faces.SelectOne";
52
53 private static final Collection<String> EVENT_NAMES = Arrays.asList("change", "click", "dblclick", "focus", "blur");
54
55 @Override
56 public Collection<String> getEventNames() {
57 return EVENT_NAMES;
58 }
59
60 @Override
61 public String getDefaultEventName() {
62 return "change";
63 }
64
65
66 enum PropertyKeys {
67 markup,
68 labelLayout,
69 focus,
70 tabIndex,
71 label,
72 help,
73 readonly,
74 size,
75 customClass,
76 disabled,
77 tip,
78 }
79
80 public String getFamily() {
81 return COMPONENT_FAMILY;
82 }
83
84
85 public org.apache.myfaces.tobago.context.Markup getMarkup() {
86 Object object = getStateHelper().eval(PropertyKeys.markup);
87 if (object != null) {
88 return Markup.valueOf(object);
89 }
90 return null;
91 }
92
93 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
94 getStateHelper().put(PropertyKeys.markup, markup);
95 }
96
97
98
99
100
101
102
103
104 public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
105 org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
106 if (labelLayout != null) {
107 return labelLayout;
108 }
109 return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
110 }
111
112 public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
113 getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
114 }
115
116
117
118
119
120 public boolean isFocus() {
121 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
122 if (bool != null) {
123 return bool;
124 }
125 return false;
126 }
127
128 public void setFocus(boolean focus) {
129 getStateHelper().put(PropertyKeys.focus, focus);
130 }
131
132
133
134
135
136
137
138
139
140
141
142
143 public java.lang.Integer getTabIndex() {
144 Number value = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
145 if (value != null) {
146 return value.intValue();
147 }
148 return null;
149 }
150
151 public void setTabIndex(java.lang.Integer tabIndex) {
152 getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
153 }
154
155
156
157
158
159 public java.lang.String getLabel() {
160 return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
161 }
162
163 public void setLabel(java.lang.String label) {
164 getStateHelper().put(PropertyKeys.label, label);
165 }
166
167
168
169
170
171 public java.lang.String getHelp() {
172 return (java.lang.String) getStateHelper().eval(PropertyKeys.help);
173 }
174
175 public void setHelp(java.lang.String help) {
176 getStateHelper().put(PropertyKeys.help, help);
177 }
178
179
180
181
182
183 public boolean isReadonly() {
184 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
185 if (bool != null) {
186 return bool;
187 }
188 return false;
189 }
190
191 public void setReadonly(boolean readonly) {
192 getStateHelper().put(PropertyKeys.readonly, readonly);
193 }
194
195
196
197
198
199 public java.lang.Integer getSize() {
200 Number value = (Number) getStateHelper().eval(PropertyKeys.size);
201 if (value != null) {
202 return value.intValue();
203 }
204 return null;
205 }
206
207 public void setSize(java.lang.Integer size) {
208 getStateHelper().put(PropertyKeys.size, size);
209 }
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228 public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
229 return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
230 }
231
232 public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
233 getStateHelper().put(PropertyKeys.customClass, customClass);
234 }
235
236
237
238
239
240 public boolean isDisabled() {
241 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
242 if (bool != null) {
243 return bool;
244 }
245 return false;
246 }
247
248 public void setDisabled(boolean disabled) {
249 getStateHelper().put(PropertyKeys.disabled, disabled);
250 }
251
252
253
254
255
256 public java.lang.String getTip() {
257 return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
258 }
259
260 public void setTip(java.lang.String tip) {
261 getStateHelper().put(PropertyKeys.tip, tip);
262 }
263
264
265 @Override
266 public void restoreState(FacesContext context, Object state) {
267
268 pushComponentToEL(context, this);
269 super.restoreState(context, state);
270 popComponentFromEL(context);
271 }
272
273 }