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.UITreeSelect;
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.TreeSelectTagDeclaration}.
33   */
34  public final class TreeSelectTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TreeSelectTag.class);
36    private javax.el.ValueExpression  validatorMessage;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  converterMessage;
39    private javax.el.ValueExpression  label;
40    private javax.el.ValueExpression  requiredMessage;
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  showCheckbox;
46    private javax.el.ValueExpression  required;
47    private javax.el.ValueExpression  disabled;
48  
49    @Override
50    public String getComponentType() {
51      return UITreeSelect.COMPONENT_TYPE;
52    }
53    @Override
54    public String getRendererType() {
55      return "TreeSelect";
56    }
57  
58    @Override
59    protected void setProperties(final UIComponent uiComponent) {
60      super.setProperties(uiComponent);
61      final UITreeSelect component = (UITreeSelect) uiComponent;
62      final FacesContext context = FacesContext.getCurrentInstance();
63      final Application application = context.getApplication();
64      if (validatorMessage != null) {
65        component.setValueExpression("validatorMessage", validatorMessage);
66      }
67  
68      if (markup != null) {
69        if (!markup.isLiteralText()) {
70          component.setValueExpression("markup", markup);
71        } else {
72          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
73        }
74      }
75      if (converterMessage != null) {
76        component.setValueExpression("converterMessage", converterMessage);
77      }
78  
79      if (label != null) {
80        component.setValueExpression("label", label);
81      }
82  
83      if (requiredMessage != null) {
84        component.setValueExpression("requiredMessage", requiredMessage);
85      }
86  
87      if (tip != null) {
88        component.setValueExpression("tip", tip);
89      }
90  
91      if (valueChangeListener != null) {
92        component.addValueChangeListener(new javax.faces.event.MethodExpressionValueChangeListener(valueChangeListener));
93      }
94      if (converter != null) {
95        if (!converter.isLiteralText()) {
96          component.setValueExpression("converter", converter);
97        } else {
98          component.setConverter(application.createConverter(converter.getExpressionString()));
99        }
100     }
101     if (value != null) {
102       component.setValueExpression("value", value);
103     }
104 
105     if (showCheckbox != null) {
106       if (!showCheckbox.isLiteralText()) {
107         component.setValueExpression("showCheckbox", showCheckbox);
108       } else {
109         component.setShowCheckbox(Boolean.parseBoolean(showCheckbox.getExpressionString()));
110       }
111     }
112     if (required != null) {
113       if (!required.isLiteralText()) {
114         component.setValueExpression("required", required);
115       } else {
116         component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
117       }
118     }
119     if (disabled != null) {
120       if (!disabled.isLiteralText()) {
121         component.setValueExpression("disabled", disabled);
122       } else {
123         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
124       }
125     }
126   }
127 
128   public javax.el.ValueExpression getValidatorMessage() {
129     return validatorMessage;
130   }
131 
132   public void setValidatorMessage(final javax.el.ValueExpression validatorMessage) {
133     this.validatorMessage = validatorMessage;
134   }
135 
136   public javax.el.ValueExpression getMarkup() {
137     return markup;
138   }
139 
140   public void setMarkup(final javax.el.ValueExpression markup) {
141     this.markup = markup;
142   }
143 
144   public javax.el.ValueExpression getConverterMessage() {
145     return converterMessage;
146   }
147 
148   public void setConverterMessage(final javax.el.ValueExpression converterMessage) {
149     this.converterMessage = converterMessage;
150   }
151 
152   public javax.el.ValueExpression getLabel() {
153     return label;
154   }
155 
156   public void setLabel(final javax.el.ValueExpression label) {
157     this.label = label;
158   }
159 
160   public javax.el.ValueExpression getRequiredMessage() {
161     return requiredMessage;
162   }
163 
164   public void setRequiredMessage(final javax.el.ValueExpression requiredMessage) {
165     this.requiredMessage = requiredMessage;
166   }
167 
168   public javax.el.ValueExpression getTip() {
169     return tip;
170   }
171 
172   public void setTip(final javax.el.ValueExpression tip) {
173     this.tip = tip;
174   }
175 
176   public javax.el.MethodExpression getValueChangeListener() {
177     return valueChangeListener;
178   }
179 
180   public void setValueChangeListener(final javax.el.MethodExpression valueChangeListener) {
181     this.valueChangeListener = valueChangeListener;
182   }
183 
184   public javax.el.ValueExpression getConverter() {
185     return converter;
186   }
187 
188   public void setConverter(final javax.el.ValueExpression converter) {
189     this.converter = converter;
190   }
191 
192   public javax.el.ValueExpression getValue() {
193     return value;
194   }
195 
196   public void setValue(final javax.el.ValueExpression value) {
197     this.value = value;
198   }
199 
200   public javax.el.ValueExpression getShowCheckbox() {
201     return showCheckbox;
202   }
203 
204   public void setShowCheckbox(final javax.el.ValueExpression showCheckbox) {
205     this.showCheckbox = showCheckbox;
206   }
207 
208   public javax.el.ValueExpression getRequired() {
209     return required;
210   }
211 
212   public void setRequired(final javax.el.ValueExpression required) {
213     this.required = required;
214   }
215 
216   public javax.el.ValueExpression getDisabled() {
217     return disabled;
218   }
219 
220   public void setDisabled(final javax.el.ValueExpression disabled) {
221     this.disabled = disabled;
222   }
223 
224 
225 
226   @Override
227   public void release() {
228     super.release();
229     validatorMessage = null;
230     markup = null;
231     converterMessage = null;
232     label = null;
233     requiredMessage = null;
234     tip = null;
235     valueChangeListener = null;
236     converter = null;
237     value = null;
238     showCheckbox = null;
239     required = null;
240     disabled = null;
241   }
242 }