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.AbstractUIFile;
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
46
47
48
49
50 @Generated("component.stg")
51 public class UIFile
52 extends AbstractUIFile {
53
54 public static final String COMPONENT_TYPE = Tags.file.componentType();
55
56 public static final String COMPONENT_FAMILY = "javax.faces.Input";
57
58 private static final Collection<String> EVENT_NAMES = Arrays.asList("change", "click", "dblclick", "focus", "blur");
59
60 @Override
61 public Collection<String> getEventNames() {
62 return EVENT_NAMES;
63 }
64
65 @Override
66 public String getDefaultEventName() {
67 return "change";
68 }
69
70
71 enum PropertyKeys {
72 markup,
73 labelLayout,
74 multiple,
75 focus,
76 tabIndex,
77 label,
78 help,
79 readonly,
80 accessKey,
81 customClass,
82 disabled,
83 tip,
84 placeholder,
85 }
86
87 public String getFamily() {
88 return COMPONENT_FAMILY;
89 }
90
91
92 public org.apache.myfaces.tobago.context.Markup getMarkup() {
93 Object object = getStateHelper().eval(PropertyKeys.markup);
94 if (object != null) {
95 return Markup.valueOf(object);
96 }
97 return null;
98 }
99
100 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
101 getStateHelper().put(PropertyKeys.markup, markup);
102 }
103
104
105
106
107
108
109
110
111 public org.apache.myfaces.tobago.component.LabelLayout getLabelLayout() {
112 org.apache.myfaces.tobago.component.LabelLayout labelLayout = (org.apache.myfaces.tobago.component.LabelLayout) getStateHelper().eval(PropertyKeys.labelLayout);
113 if (labelLayout != null) {
114 return labelLayout;
115 }
116 return getLabel() != null ? org.apache.myfaces.tobago.component.LabelLayout.flexLeft : org.apache.myfaces.tobago.component.LabelLayout.none;
117 }
118
119 public void setLabelLayout(org.apache.myfaces.tobago.component.LabelLayout labelLayout) {
120 getStateHelper().put(PropertyKeys.labelLayout, labelLayout);
121 }
122
123 public boolean isMultiple() {
124 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.multiple);
125 if (bool != null) {
126 return bool;
127 }
128 return false;
129 }
130
131 public void setMultiple(boolean multiple) {
132 getStateHelper().put(PropertyKeys.multiple, multiple);
133 }
134
135
136
137
138
139 public boolean isFocus() {
140 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.focus);
141 if (bool != null) {
142 return bool;
143 }
144 return false;
145 }
146
147 public void setFocus(boolean focus) {
148 getStateHelper().put(PropertyKeys.focus, focus);
149 }
150
151
152
153
154
155
156
157
158
159
160
161
162 public java.lang.Integer getTabIndex() {
163 Number value = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
164 if (value != null) {
165 return value.intValue();
166 }
167 return null;
168 }
169
170 public void setTabIndex(java.lang.Integer tabIndex) {
171 getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
172 }
173
174
175
176
177
178 public java.lang.String getLabel() {
179 return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
180 }
181
182 public void setLabel(java.lang.String label) {
183 getStateHelper().put(PropertyKeys.label, label);
184 }
185
186
187
188
189
190 public java.lang.String getHelp() {
191 return (java.lang.String) getStateHelper().eval(PropertyKeys.help);
192 }
193
194 public void setHelp(java.lang.String help) {
195 getStateHelper().put(PropertyKeys.help, help);
196 }
197
198
199
200
201
202 public boolean isReadonly() {
203 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
204 if (bool != null) {
205 return bool;
206 }
207 return false;
208 }
209
210 public void setReadonly(boolean readonly) {
211 getStateHelper().put(PropertyKeys.readonly, readonly);
212 }
213
214
215
216
217
218 public java.lang.Character getAccessKey() {
219 return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
220 }
221
222 public void setAccessKey(java.lang.Character accessKey) {
223 getStateHelper().put(PropertyKeys.accessKey, accessKey);
224 }
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243 public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
244 return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
245 }
246
247 public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
248 getStateHelper().put(PropertyKeys.customClass, customClass);
249 }
250
251
252
253
254
255 public boolean isDisabled() {
256 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
257 if (bool != null) {
258 return bool;
259 }
260 return false;
261 }
262
263 public void setDisabled(boolean disabled) {
264 getStateHelper().put(PropertyKeys.disabled, disabled);
265 }
266
267
268
269
270
271 public java.lang.String getTip() {
272 return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
273 }
274
275 public void setTip(java.lang.String tip) {
276 getStateHelper().put(PropertyKeys.tip, tip);
277 }
278
279
280
281
282
283
284
285 public java.lang.String getPlaceholder() {
286 return (java.lang.String) getStateHelper().eval(PropertyKeys.placeholder);
287 }
288
289 public void setPlaceholder(java.lang.String placeholder) {
290 getStateHelper().put(PropertyKeys.placeholder, placeholder);
291 }
292
293
294 @Override
295 public void restoreState(FacesContext context, Object state) {
296
297 pushComponentToEL(context, this);
298 super.restoreState(context, state);
299 popComponentFromEL(context);
300 }
301
302 }