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  markup;
38    private javax.el.MethodExpression  validator;
39    private javax.el.ValueExpression  tabIndex;
40    private javax.el.ValueExpression  tip;
41    private javax.el.MethodExpression  valueChangeListener;
42    private javax.el.ValueExpression  converter;
43    private javax.el.ValueExpression  value;
44    private javax.el.ValueExpression  focus;
45    private javax.el.ValueExpression  required;
46    private javax.el.ValueExpression  converterMessage;
47    private javax.el.ValueExpression  label;
48    private javax.el.ValueExpression  requiredMessage;
49    private javax.el.ValueExpression  onchange;
50    private javax.el.ValueExpression  readonly;
51    private javax.el.ValueExpression  disabled;
52  
53    @Override
54    public String getComponentType() {
55      return UISelectManyListbox.COMPONENT_TYPE;
56    }
57    @Override
58    public String getRendererType() {
59      return "SelectManyListbox";
60    }
61  
62    @Override
63    protected void setProperties(final UIComponent uiComponent) {
64      super.setProperties(uiComponent);
65      final UISelectManyListbox component = (UISelectManyListbox) uiComponent;
66      final FacesContext context = FacesContext.getCurrentInstance();
67      final Application application = context.getApplication();
68      if (validatorMessage != null) {
69        component.setValueExpression("validatorMessage", validatorMessage);
70      }
71  
72      if (markup != null) {
73        if (!markup.isLiteralText()) {
74          component.setValueExpression("markup", markup);
75        } else {
76          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
77        }
78      }
79      if (validator != null) {
80        component.addValidator(new javax.faces.validator.MethodExpressionValidator(validator));
81      }
82      if (tabIndex != null) {
83        if (!tabIndex.isLiteralText()) {
84          component.setValueExpression("tabIndex", tabIndex);
85        } else {
86          component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
87        }
88      }
89      if (tip != null) {
90        component.setValueExpression("tip", tip);
91      }
92  
93      if (valueChangeListener != null) {
94        component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
95      }
96      if (converter != null) {
97        if (!converter.isLiteralText()) {
98          component.setValueExpression("converter", converter);
99        } else {
100         component.setConverter(application.createConverter(converter.getExpressionString()));
101       }
102     }
103     if (value != null) {
104       component.setValueExpression("value", value);
105     }
106 
107     if (focus != null) {
108       if (!focus.isLiteralText()) {
109         component.setValueExpression("focus", focus);
110       } else {
111         component.setFocus(Boolean.parseBoolean(focus.getExpressionString()));
112       }
113     }
114     if (required != null) {
115       if (!required.isLiteralText()) {
116         component.setValueExpression("required", required);
117       } else {
118         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
119       }
120     }
121     if (converterMessage != null) {
122       component.setValueExpression("converterMessage", converterMessage);
123     }
124 
125     if (label != null) {
126       component.setValueExpression("label", label);
127     }
128 
129     if (requiredMessage != null) {
130       component.setValueExpression("requiredMessage", requiredMessage);
131     }
132 
133     if (onchange != null) {
134       component.setValueExpression("onchange", onchange);
135     }
136 
137     if (readonly != null) {
138       if (!readonly.isLiteralText()) {
139         component.setValueExpression("readonly", readonly);
140       } else {
141         component.setReadonly(Boolean.parseBoolean(readonly.getExpressionString()));
142       }
143     }
144     if (disabled != null) {
145       if (!disabled.isLiteralText()) {
146         component.setValueExpression("disabled", disabled);
147       } else {
148         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
149       }
150     }
151   }
152 
153   public javax.el.ValueExpression getValidatorMessage() {
154     return validatorMessage;
155   }
156 
157   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
158     this.validatorMessage = validatorMessage;
159   }
160 
161   public javax.el.ValueExpression getMarkup() {
162     return markup;
163   }
164 
165   public void setMarkup(final javax.el.ValueExpression markup) {
166     this.markup = markup;
167   }
168 
169   public javax.el.MethodExpression getValidator() {
170     return validator;
171   }
172 
173   public void setValidator(final javax.el.MethodExpression validator) {
174     this.validator = validator;
175   }
176 
177   public javax.el.ValueExpression getTabIndex() {
178     return tabIndex;
179   }
180 
181   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
182     this.tabIndex = tabIndex;
183   }
184 
185   public javax.el.ValueExpression getTip() {
186     return tip;
187   }
188 
189   public void setTip(final javax.el.ValueExpression tip) {
190     this.tip = tip;
191   }
192 
193   public javax.el.MethodExpression getValueChangeListener() {
194     return valueChangeListener;
195   }
196 
197   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
198     this.valueChangeListener = valueChangeListener;
199   }
200 
201   public javax.el.ValueExpression getConverter() {
202     return converter;
203   }
204 
205   public void setConverter(final javax.el.ValueExpression converter) {
206     this.converter = converter;
207   }
208 
209   public javax.el.ValueExpression getValue() {
210     return value;
211   }
212 
213   public void setValue(final javax.el.ValueExpression value) {
214     this.value = value;
215   }
216 
217   public javax.el.ValueExpression getFocus() {
218     return focus;
219   }
220 
221   public void setFocus(final javax.el.ValueExpression focus) {
222     this.focus = focus;
223   }
224 
225   public javax.el.ValueExpression getRequired() {
226     return required;
227   }
228 
229   public void setRequired(final javax.el.ValueExpression required) {
230     this.required = required;
231   }
232 
233   public javax.el.ValueExpression getConverterMessage() {
234     return converterMessage;
235   }
236 
237   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
238     this.converterMessage = converterMessage;
239   }
240 
241   public javax.el.ValueExpression getLabel() {
242     return label;
243   }
244 
245   public void setLabel(final javax.el.ValueExpression label) {
246     this.label = label;
247   }
248 
249   public javax.el.ValueExpression getRequiredMessage() {
250     return requiredMessage;
251   }
252 
253   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
254     this.requiredMessage = requiredMessage;
255   }
256 
257   public javax.el.ValueExpression getOnchange() {
258     return onchange;
259   }
260 
261   public void setOnchange(final javax.el.ValueExpression onchange) {
262     this.onchange = onchange;
263   }
264 
265   public javax.el.ValueExpression getReadonly() {
266     return readonly;
267   }
268 
269   public void setReadonly(final javax.el.ValueExpression readonly) {
270     this.readonly = readonly;
271   }
272 
273   public javax.el.ValueExpression getDisabled() {
274     return disabled;
275   }
276 
277   public void setDisabled(final javax.el.ValueExpression disabled) {
278     this.disabled = disabled;
279   }
280 
281 
282 
283   @Override
284   public void release() {
285     super.release();
286     validatorMessage = null;
287     markup = null;
288     validator = null;
289     tabIndex = null;
290     tip = null;
291     valueChangeListener = null;
292     converter = null;
293     value = null;
294     focus = null;
295     required = null;
296     converterMessage = null;
297     label = null;
298     requiredMessage = null;
299     onchange = null;
300     readonly = null;
301     disabled = null;
302   }
303 }