View Javadoc

1   // ---------- Attention: Generated code, please do not modify! -----------  
2   
3   /*
4    * Licensed to the Apache Software Foundation (ASF) under one or more
5    * contributor license agreements.  See the NOTICE file distributed with
6    * this work for additional information regarding copyright ownership.
7    * The ASF licenses this file to You under the Apache License, Version 2.0
8    * (the "License"); you may not use this file except in compliance with
9    * the License.  You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   */
19  
20  package org.apache.myfaces.tobago.internal.taglib;
21  
22  import javax.faces.application.Application;
23  import javax.faces.component.UIComponent;
24  import javax.faces.context.FacesContext;
25  import org.apache.myfaces.tobago.component.UISelectManyListbox;
26  import org.apache.myfaces.tobago.internal.util.StringUtils;
27  import org.slf4j.Logger;
28  import org.slf4j.LoggerFactory;
29  
30  /** 
31   * JSP Tag class, generated from template {@code tag1.2.stg} with class 
32   * {@link org.apache.myfaces.tobago.internal.taglib.component.SelectManyListboxTagDeclaration}.
33   */
34  public final class SelectManyListboxTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(SelectManyListboxTag.class);
36    private javax.el.ValueExpression  validatorMessage;
37    private javax.el.ValueExpression  accessKey;
38    private javax.el.ValueExpression  markup;
39    private javax.el.MethodExpression  validator;
40    private javax.el.ValueExpression  labelWithAccessKey;
41    private javax.el.ValueExpression  tabIndex;
42    private javax.el.ValueExpression  tip;
43    private javax.el.MethodExpression  valueChangeListener;
44    private javax.el.ValueExpression  converter;
45    private javax.el.ValueExpression  inline;
46    private javax.el.ValueExpression  value;
47    private javax.el.ValueExpression  focus;
48    private javax.el.ValueExpression  required;
49    private javax.el.ValueExpression  converterMessage;
50    private javax.el.ValueExpression  label;
51    private javax.el.ValueExpression  requiredMessage;
52    private javax.el.ValueExpression  onchange;
53    private javax.el.ValueExpression  readonly;
54    private javax.el.ValueExpression  disabled;
55  
56    @Override
57    public String getComponentType() {
58      return UISelectManyListbox.COMPONENT_TYPE;
59    }
60    @Override
61    public String getRendererType() {
62      return "SelectManyListbox";
63    }
64  
65    @Override
66    protected void setProperties(final UIComponent uiComponent) {
67      super.setProperties(uiComponent);
68      final UISelectManyListbox component = (UISelectManyListbox) uiComponent;
69      final FacesContext context = FacesContext.getCurrentInstance();
70      final Application application = context.getApplication();
71      if (validatorMessage != null) {
72        component.setValueExpression("validatorMessage", validatorMessage);
73      }
74  
75      if (accessKey != null) {
76        if (!accessKey.isLiteralText()) {
77          component.setValueExpression("accessKey", accessKey);
78        } else {
79          component.setAccessKey(accessKey.getExpressionString().charAt(0));
80        }
81      }
82      if (markup != null) {
83        if (!markup.isLiteralText()) {
84          component.setValueExpression("markup", markup);
85        } else {
86          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
87        }
88      }
89      if (validator != null) {
90        component.addValidator(new javax.faces.validator.MethodExpressionValidator(validator));
91      }
92      if (labelWithAccessKey != null) {
93        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
94      }
95  
96      if (tabIndex != null) {
97        if (!tabIndex.isLiteralText()) {
98          component.setValueExpression("tabIndex", tabIndex);
99        } else {
100         component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
101       }
102     }
103     if (tip != null) {
104       component.setValueExpression("tip", tip);
105     }
106 
107     if (valueChangeListener != null) {
108       component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
109     }
110     if (converter != null) {
111       if (!converter.isLiteralText()) {
112         component.setValueExpression("converter", converter);
113       } else {
114         component.setConverter(application.createConverter(converter.getExpressionString()));
115       }
116     }
117     if (inline != null) {
118       if (!inline.isLiteralText()) {
119         component.setValueExpression("inline", inline);
120       } else {
121         component.setInline(Boolean.parseBoolean(inline.getExpressionString()));
122       }
123     }
124     if (value != null) {
125       component.setValueExpression("value", value);
126     }
127 
128     if (focus != null) {
129       if (!focus.isLiteralText()) {
130         component.setValueExpression("focus", focus);
131       } else {
132         component.setFocus(Boolean.parseBoolean(focus.getExpressionString()));
133       }
134     }
135     if (required != null) {
136       if (!required.isLiteralText()) {
137         component.setValueExpression("required", required);
138       } else {
139         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
140       }
141     }
142     if (converterMessage != null) {
143       component.setValueExpression("converterMessage", converterMessage);
144     }
145 
146     if (label != null) {
147       component.setValueExpression("label", label);
148     }
149 
150     if (requiredMessage != null) {
151       component.setValueExpression("requiredMessage", requiredMessage);
152     }
153 
154     if (onchange != null) {
155       component.setValueExpression("onchange", onchange);
156     }
157 
158     if (readonly != null) {
159       if (!readonly.isLiteralText()) {
160         component.setValueExpression("readonly", readonly);
161       } else {
162         component.setReadonly(Boolean.parseBoolean(readonly.getExpressionString()));
163       }
164     }
165     if (disabled != null) {
166       if (!disabled.isLiteralText()) {
167         component.setValueExpression("disabled", disabled);
168       } else {
169         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
170       }
171     }
172   }
173 
174   public javax.el.ValueExpression getValidatorMessage() {
175     return validatorMessage;
176   }
177 
178   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
179     this.validatorMessage = validatorMessage;
180   }
181 
182   public javax.el.ValueExpression getAccessKey() {
183     return accessKey;
184   }
185 
186   public void setAccessKey(final javax.el.ValueExpression accessKey) {
187     this.accessKey = accessKey;
188   }
189 
190   public javax.el.ValueExpression getMarkup() {
191     return markup;
192   }
193 
194   public void setMarkup(final javax.el.ValueExpression markup) {
195     this.markup = markup;
196   }
197 
198   public javax.el.MethodExpression getValidator() {
199     return validator;
200   }
201 
202   public void setValidator(final javax.el.MethodExpression validator) {
203     this.validator = validator;
204   }
205 
206   public javax.el.ValueExpression getLabelWithAccessKey() {
207     return labelWithAccessKey;
208   }
209 
210   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
211     this.labelWithAccessKey = labelWithAccessKey;
212   }
213 
214   public javax.el.ValueExpression getTabIndex() {
215     return tabIndex;
216   }
217 
218   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
219     this.tabIndex = tabIndex;
220   }
221 
222   public javax.el.ValueExpression getTip() {
223     return tip;
224   }
225 
226   public void setTip(final javax.el.ValueExpression tip) {
227     this.tip = tip;
228   }
229 
230   public javax.el.MethodExpression getValueChangeListener() {
231     return valueChangeListener;
232   }
233 
234   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
235     this.valueChangeListener = valueChangeListener;
236   }
237 
238   public javax.el.ValueExpression getConverter() {
239     return converter;
240   }
241 
242   public void setConverter(final javax.el.ValueExpression converter) {
243     this.converter = converter;
244   }
245 
246   public javax.el.ValueExpression getInline() {
247     return inline;
248   }
249 
250   public void setInline(final javax.el.ValueExpression inline) {
251     this.inline = inline;
252   }
253 
254   public javax.el.ValueExpression getValue() {
255     return value;
256   }
257 
258   public void setValue(final javax.el.ValueExpression value) {
259     this.value = value;
260   }
261 
262   public javax.el.ValueExpression getFocus() {
263     return focus;
264   }
265 
266   public void setFocus(final javax.el.ValueExpression focus) {
267     this.focus = focus;
268   }
269 
270   public javax.el.ValueExpression getRequired() {
271     return required;
272   }
273 
274   public void setRequired(final javax.el.ValueExpression required) {
275     this.required = required;
276   }
277 
278   public javax.el.ValueExpression getConverterMessage() {
279     return converterMessage;
280   }
281 
282   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
283     this.converterMessage = converterMessage;
284   }
285 
286   public javax.el.ValueExpression getLabel() {
287     return label;
288   }
289 
290   public void setLabel(final javax.el.ValueExpression label) {
291     this.label = label;
292   }
293 
294   public javax.el.ValueExpression getRequiredMessage() {
295     return requiredMessage;
296   }
297 
298   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
299     this.requiredMessage = requiredMessage;
300   }
301 
302   public javax.el.ValueExpression getOnchange() {
303     return onchange;
304   }
305 
306   public void setOnchange(final javax.el.ValueExpression onchange) {
307     this.onchange = onchange;
308   }
309 
310   public javax.el.ValueExpression getReadonly() {
311     return readonly;
312   }
313 
314   public void setReadonly(final javax.el.ValueExpression readonly) {
315     this.readonly = readonly;
316   }
317 
318   public javax.el.ValueExpression getDisabled() {
319     return disabled;
320   }
321 
322   public void setDisabled(final javax.el.ValueExpression disabled) {
323     this.disabled = disabled;
324   }
325 
326 
327 
328   @Override
329   public void release() {
330     super.release();
331     validatorMessage = null;
332     accessKey = null;
333     markup = null;
334     validator = null;
335     labelWithAccessKey = null;
336     tabIndex = null;
337     tip = null;
338     valueChangeListener = null;
339     converter = null;
340     inline = null;
341     value = null;
342     focus = null;
343     required = null;
344     converterMessage = null;
345     label = null;
346     requiredMessage = null;
347     onchange = null;
348     readonly = null;
349     disabled = null;
350   }
351 }