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.UIToolBarCheck;
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.ToolBarSelectBooleanTagDeclaration}.
33   */
34  public final class ToolBarCheckTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(ToolBarCheckTag.class);
36    private javax.el.MethodExpression  actionListener;
37    private javax.el.ValueExpression  accessKey;
38    private javax.el.ValueExpression  labelWithAccessKey;
39    private javax.el.ValueExpression  link;
40    private javax.el.ValueExpression  resource;
41    private javax.el.ValueExpression  jsfResource;
42    private javax.el.ValueExpression  image;
43    private javax.el.ValueExpression  transition;
44    private javax.el.ValueExpression  label;
45    private javax.el.ValueExpression  tip;
46    private javax.el.ValueExpression  immediate;
47    private javax.el.ValueExpression  omit;
48    private javax.el.ValueExpression  value;
49    private javax.el.MethodExpression  action;
50    private javax.el.ValueExpression  target;
51    private javax.el.ValueExpression  renderedPartially;
52    private javax.el.ValueExpression  onclick;
53    private javax.el.ValueExpression  disabled;
54  
55    @Override
56    public String getComponentType() {
57      return UIToolBarCheck.COMPONENT_TYPE;
58    }
59    @Override
60    public String getRendererType() {
61      return "MenuCommand";
62    }
63  
64    @Override
65    protected void setProperties(final UIComponent uiComponent) {
66      super.setProperties(uiComponent);
67      final UIToolBarCheck component = (UIToolBarCheck) uiComponent;
68      final FacesContext context = FacesContext.getCurrentInstance();
69      final Application application = context.getApplication();
70      if (actionListener != null) {
71        component.addActionListener(new javax.faces.event.MethodExpressionActionListener(actionListener));
72      }
73      if (accessKey != null) {
74        if (!accessKey.isLiteralText()) {
75          component.setValueExpression("accessKey", accessKey);
76        } else {
77          component.setAccessKey(accessKey.getExpressionString().charAt(0));
78        }
79      }
80      if (labelWithAccessKey != null) {
81        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
82      }
83  
84      if (link != null) {
85        component.setValueExpression("link", link);
86      }
87  
88      if (resource != null) {
89        component.setValueExpression("resource", resource);
90      }
91  
92      if (jsfResource != null) {
93        if (!jsfResource.isLiteralText()) {
94          component.setValueExpression("jsfResource", jsfResource);
95        } else {
96          component.setJsfResource(Boolean.parseBoolean(jsfResource.getExpressionString()));
97        }
98      }
99      if (image != null) {
100       component.setValueExpression("image", image);
101     }
102 
103     if (transition != null) {
104       if (!transition.isLiteralText()) {
105         component.setValueExpression("transition", transition);
106       } else {
107         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
108       }
109     }
110     if (label != null) {
111       component.setValueExpression("label", label);
112     }
113 
114     if (tip != null) {
115       component.setValueExpression("tip", tip);
116     }
117 
118     if (immediate != null) {
119       if (!immediate.isLiteralText()) {
120         component.setValueExpression("immediate", immediate);
121       } else {
122         component.setImmediate(Boolean.parseBoolean(immediate.getExpressionString()));
123       }
124     }
125     if (omit != null) {
126       if (!omit.isLiteralText()) {
127         component.setValueExpression("omit", omit);
128       } else {
129         component.setOmit(Boolean.parseBoolean(omit.getExpressionString()));
130       }
131     }
132     if (value != null) {
133       component.setValueExpression("value", value);
134     }
135 
136     if (action != null) {
137       component.setActionExpression(action);
138     }
139     if (target != null) {
140       component.setValueExpression("target", target);
141     }
142 
143     if (renderedPartially != null) {
144       if (!renderedPartially.isLiteralText()) {
145         component.setValueExpression("renderedPartially", renderedPartially);
146       } else {
147         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
148       }
149     }
150     if (onclick != null) {
151       component.setValueExpression("onclick", onclick);
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.MethodExpression getActionListener() {
164     return actionListener;
165   }
166 
167   public void setActionListener(final javax.el.MethodExpression actionListener) {
168     this.actionListener = actionListener;
169   }
170 
171   public javax.el.ValueExpression getAccessKey() {
172     return accessKey;
173   }
174 
175   public void setAccessKey(final javax.el.ValueExpression accessKey) {
176     this.accessKey = accessKey;
177   }
178 
179   public javax.el.ValueExpression getLabelWithAccessKey() {
180     return labelWithAccessKey;
181   }
182 
183   public void setLabelWithAccessKey(final javax.el.ValueExpression labelWithAccessKey) {
184     this.labelWithAccessKey = labelWithAccessKey;
185   }
186 
187   public javax.el.ValueExpression getLink() {
188     return link;
189   }
190 
191   public void setLink(final javax.el.ValueExpression link) {
192     this.link = link;
193   }
194 
195   public javax.el.ValueExpression getResource() {
196     return resource;
197   }
198 
199   public void setResource(final javax.el.ValueExpression resource) {
200     this.resource = resource;
201   }
202 
203   public javax.el.ValueExpression getJsfResource() {
204     return jsfResource;
205   }
206 
207   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
208     this.jsfResource = jsfResource;
209   }
210 
211   public javax.el.ValueExpression getImage() {
212     return image;
213   }
214 
215   public void setImage(final javax.el.ValueExpression image) {
216     this.image = image;
217   }
218 
219   public javax.el.ValueExpression getTransition() {
220     return transition;
221   }
222 
223   public void setTransition(final javax.el.ValueExpression transition) {
224     this.transition = transition;
225   }
226 
227   public javax.el.ValueExpression getLabel() {
228     return label;
229   }
230 
231   public void setLabel(final javax.el.ValueExpression label) {
232     this.label = label;
233   }
234 
235   public javax.el.ValueExpression getTip() {
236     return tip;
237   }
238 
239   public void setTip(final javax.el.ValueExpression tip) {
240     this.tip = tip;
241   }
242 
243   public javax.el.ValueExpression getImmediate() {
244     return immediate;
245   }
246 
247   public void setImmediate(final javax.el.ValueExpression immediate) {
248     this.immediate = immediate;
249   }
250 
251   public javax.el.ValueExpression getOmit() {
252     return omit;
253   }
254 
255   public void setOmit(final javax.el.ValueExpression omit) {
256     this.omit = omit;
257   }
258 
259   public javax.el.ValueExpression getValue() {
260     return value;
261   }
262 
263   public void setValue(final javax.el.ValueExpression value) {
264     this.value = value;
265   }
266 
267   public javax.el.MethodExpression getAction() {
268     return action;
269   }
270 
271   public void setAction(final javax.el.MethodExpression action) {
272     this.action = action;
273   }
274 
275   public javax.el.ValueExpression getTarget() {
276     return target;
277   }
278 
279   public void setTarget(final javax.el.ValueExpression target) {
280     this.target = target;
281   }
282 
283   public javax.el.ValueExpression getRenderedPartially() {
284     return renderedPartially;
285   }
286 
287   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
288     this.renderedPartially = renderedPartially;
289   }
290 
291   public javax.el.ValueExpression getOnclick() {
292     return onclick;
293   }
294 
295   public void setOnclick(final javax.el.ValueExpression onclick) {
296     this.onclick = onclick;
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     actionListener = null;
313     accessKey = null;
314     labelWithAccessKey = null;
315     link = null;
316     resource = null;
317     jsfResource = null;
318     image = null;
319     transition = null;
320     label = null;
321     tip = null;
322     immediate = null;
323     omit = null;
324     value = null;
325     action = null;
326     target = null;
327     renderedPartially = null;
328     onclick = null;
329     disabled = null;
330   }
331 }