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