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