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.AbstractUIButton;
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 UIButton
47 extends AbstractUIButton implements SupportsAccessKey {
48
49 public static final String COMPONENT_TYPE = Tags.button.componentType();
50
51 public static final String COMPONENT_FAMILY = "javax.faces.Command";
52
53 private static final Collection<String> EVENT_NAMES = Arrays.asList("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 "click";
63 }
64
65
66 enum PropertyKeys {
67 image,
68 markup,
69 link,
70 tabIndex,
71 confirmation,
72 label,
73 transition,
74 target,
75 defaultCommand,
76 fragment,
77 accessKey,
78 customClass,
79 tip,
80 omit,
81 outcome,
82 }
83
84 public String getFamily() {
85 return COMPONENT_FAMILY;
86 }
87
88
89
90
91
92
93 public java.lang.String getImage() {
94 return (java.lang.String) getStateHelper().eval(PropertyKeys.image);
95 }
96
97 public void setImage(java.lang.String image) {
98 getStateHelper().put(PropertyKeys.image, image);
99 }
100
101 public org.apache.myfaces.tobago.context.Markup getMarkup() {
102 Object object = getStateHelper().eval(PropertyKeys.markup);
103 if (object != null) {
104 return Markup.valueOf(object);
105 }
106 return null;
107 }
108
109 public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
110 getStateHelper().put(PropertyKeys.markup, markup);
111 }
112
113
114
115
116
117
118
119
120
121
122
123
124
125 public java.lang.String getLink() {
126 return (java.lang.String) getStateHelper().eval(PropertyKeys.link);
127 }
128
129 public void setLink(java.lang.String link) {
130 getStateHelper().put(PropertyKeys.link, link);
131 }
132
133
134
135
136
137
138
139
140
141
142
143
144 public java.lang.Integer getTabIndex() {
145 Number value = (Number) getStateHelper().eval(PropertyKeys.tabIndex);
146 if (value != null) {
147 return value.intValue();
148 }
149 return null;
150 }
151
152 public void setTabIndex(java.lang.Integer tabIndex) {
153 getStateHelper().put(PropertyKeys.tabIndex, tabIndex);
154 }
155
156
157
158
159
160 public java.lang.String getConfirmation() {
161 return (java.lang.String) getStateHelper().eval(PropertyKeys.confirmation);
162 }
163
164 public void setConfirmation(java.lang.String confirmation) {
165 getStateHelper().put(PropertyKeys.confirmation, confirmation);
166 }
167
168
169
170
171
172 public java.lang.String getLabel() {
173 return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
174 }
175
176 public void setLabel(java.lang.String label) {
177 getStateHelper().put(PropertyKeys.label, label);
178 }
179
180
181
182
183
184
185 public boolean isTransition() {
186 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.transition);
187 if (bool != null) {
188 return bool;
189 }
190 return true;
191 }
192
193 public void setTransition(boolean transition) {
194 getStateHelper().put(PropertyKeys.transition, transition);
195 }
196
197
198
199
200
201
202 public java.lang.String getTarget() {
203 return (java.lang.String) getStateHelper().eval(PropertyKeys.target);
204 }
205
206 public void setTarget(java.lang.String target) {
207 getStateHelper().put(PropertyKeys.target, target);
208 }
209
210
211
212
213
214
215 public boolean isDefaultCommand() {
216 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.defaultCommand);
217 if (bool != null) {
218 return bool;
219 }
220 return false;
221 }
222
223 public void setDefaultCommand(boolean defaultCommand) {
224 getStateHelper().put(PropertyKeys.defaultCommand, defaultCommand);
225 }
226
227
228
229
230
231
232
233
234
235 public java.lang.String getFragment() {
236 return (java.lang.String) getStateHelper().eval(PropertyKeys.fragment);
237 }
238
239 public void setFragment(java.lang.String fragment) {
240 getStateHelper().put(PropertyKeys.fragment, fragment);
241 }
242
243
244
245
246
247 public java.lang.Character getAccessKey() {
248 return (java.lang.Character) getStateHelper().eval(PropertyKeys.accessKey);
249 }
250
251 public void setAccessKey(java.lang.Character accessKey) {
252 getStateHelper().put(PropertyKeys.accessKey, accessKey);
253 }
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272 public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
273 return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
274 }
275
276 public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
277 getStateHelper().put(PropertyKeys.customClass, customClass);
278 }
279
280
281
282
283
284 public java.lang.String getTip() {
285 return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
286 }
287
288 public void setTip(java.lang.String tip) {
289 getStateHelper().put(PropertyKeys.tip, tip);
290 }
291
292
293
294
295
296
297
298
299
300
301 public boolean isOmit() {
302 Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.omit);
303 if (bool != null) {
304 return bool;
305 }
306 return false;
307 }
308
309 public void setOmit(boolean omit) {
310 getStateHelper().put(PropertyKeys.omit, omit);
311 }
312
313
314
315
316
317
318
319 public java.lang.String getOutcome() {
320 return (java.lang.String) getStateHelper().eval(PropertyKeys.outcome);
321 }
322
323 public void setOutcome(java.lang.String outcome) {
324 getStateHelper().put(PropertyKeys.outcome, outcome);
325 }
326
327
328 @Override
329 public void restoreState(FacesContext context, Object state) {
330
331 pushComponentToEL(context, this);
332 super.restoreState(context, state);
333 popComponentFromEL(context);
334 }
335
336 }