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.commons.lang.StringUtils;
26  import org.apache.myfaces.tobago.component.UIToolBarCheck;
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  link;
39    private javax.el.ValueExpression  labelWithAccessKey;
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  value;
48    private javax.el.MethodExpression  action;
49    private javax.el.ValueExpression  target;
50    private javax.el.ValueExpression  renderedPartially;
51    private javax.el.ValueExpression  onclick;
52    private javax.el.ValueExpression  disabled;
53  
54    @Override
55    public String getComponentType() {
56      return UIToolBarCheck.COMPONENT_TYPE;
57    }
58    @Override
59    public String getRendererType() {
60      return "MenuCommand";
61    }
62  
63    @Override
64    protected void setProperties(final UIComponent uiComponent) {
65      super.setProperties(uiComponent);
66      final UIToolBarCheck component = (UIToolBarCheck) uiComponent;
67      final FacesContext context = FacesContext.getCurrentInstance();
68      final Application application = context.getApplication();
69      if (actionListener != null) {
70        component.addActionListener(new javax.faces.event.MethodExpressionActionListener(actionListener));
71      }
72      if (accessKey != null) {
73        if (!accessKey.isLiteralText()) {
74          component.setValueExpression("accessKey", accessKey);
75        } else {
76          component.setAccessKey(accessKey.getExpressionString().charAt(0));
77        }
78      }
79      if (link != null) {
80        component.setValueExpression("link", link);
81      }
82  
83      if (labelWithAccessKey != null) {
84        component.setValueExpression("labelWithAccessKey", labelWithAccessKey);
85      }
86  
87      if (resource != null) {
88        component.setValueExpression("resource", resource);
89      }
90  
91      if (jsfResource != null) {
92        if (!jsfResource.isLiteralText()) {
93          component.setValueExpression("jsfResource", jsfResource);
94        } else {
95          component.setJsfResource(Boolean.parseBoolean(jsfResource.getExpressionString()));
96        }
97      }
98      if (image != null) {
99        component.setValueExpression("image", image);
100     }
101 
102     if (transition != null) {
103       if (!transition.isLiteralText()) {
104         component.setValueExpression("transition", transition);
105       } else {
106         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
107       }
108     }
109     if (label != null) {
110       component.setValueExpression("label", label);
111     }
112 
113     if (tip != null) {
114       component.setValueExpression("tip", tip);
115     }
116 
117     if (immediate != null) {
118       if (!immediate.isLiteralText()) {
119         component.setValueExpression("immediate", immediate);
120       } else {
121         component.setImmediate(Boolean.parseBoolean(immediate.getExpressionString()));
122       }
123     }
124     if (value != null) {
125       component.setValueExpression("value", value);
126     }
127 
128     if (action != null) {
129       component.setActionExpression(action);
130     }
131     if (target != null) {
132       component.setValueExpression("target", target);
133     }
134 
135     if (renderedPartially != null) {
136       if (!renderedPartially.isLiteralText()) {
137         component.setValueExpression("renderedPartially", renderedPartially);
138       } else {
139         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
140       }
141     }
142     if (onclick != null) {
143       component.setValueExpression("onclick", onclick);
144     }
145 
146     if (disabled != null) {
147       if (!disabled.isLiteralText()) {
148         component.setValueExpression("disabled", disabled);
149       } else {
150         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
151       }
152     }
153   }
154 
155   public javax.el.MethodExpression getActionListener() {
156     return actionListener;
157   }
158 
159   public void setActionListener(final javax.el.MethodExpression actionListener) {
160     this.actionListener = actionListener;
161   }
162 
163   public javax.el.ValueExpression getAccessKey() {
164     return accessKey;
165   }
166 
167   public void setAccessKey(final javax.el.ValueExpression accessKey) {
168     this.accessKey = accessKey;
169   }
170 
171   public javax.el.ValueExpression getLink() {
172     return link;
173   }
174 
175   public void setLink(final javax.el.ValueExpression link) {
176     this.link = link;
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 getResource() {
188     return resource;
189   }
190 
191   public void setResource(final javax.el.ValueExpression resource) {
192     this.resource = resource;
193   }
194 
195   public javax.el.ValueExpression getJsfResource() {
196     return jsfResource;
197   }
198 
199   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
200     this.jsfResource = jsfResource;
201   }
202 
203   public javax.el.ValueExpression getImage() {
204     return image;
205   }
206 
207   public void setImage(final javax.el.ValueExpression image) {
208     this.image = image;
209   }
210 
211   public javax.el.ValueExpression getTransition() {
212     return transition;
213   }
214 
215   public void setTransition(final javax.el.ValueExpression transition) {
216     this.transition = transition;
217   }
218 
219   public javax.el.ValueExpression getLabel() {
220     return label;
221   }
222 
223   public void setLabel(final javax.el.ValueExpression label) {
224     this.label = label;
225   }
226 
227   public javax.el.ValueExpression getTip() {
228     return tip;
229   }
230 
231   public void setTip(final javax.el.ValueExpression tip) {
232     this.tip = tip;
233   }
234 
235   public javax.el.ValueExpression getImmediate() {
236     return immediate;
237   }
238 
239   public void setImmediate(final javax.el.ValueExpression immediate) {
240     this.immediate = immediate;
241   }
242 
243   public javax.el.ValueExpression getValue() {
244     return value;
245   }
246 
247   public void setValue(final javax.el.ValueExpression value) {
248     this.value = value;
249   }
250 
251   public javax.el.MethodExpression getAction() {
252     return action;
253   }
254 
255   public void setAction(final javax.el.MethodExpression action) {
256     this.action = action;
257   }
258 
259   public javax.el.ValueExpression getTarget() {
260     return target;
261   }
262 
263   public void setTarget(final javax.el.ValueExpression target) {
264     this.target = target;
265   }
266 
267   public javax.el.ValueExpression getRenderedPartially() {
268     return renderedPartially;
269   }
270 
271   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
272     this.renderedPartially = renderedPartially;
273   }
274 
275   public javax.el.ValueExpression getOnclick() {
276     return onclick;
277   }
278 
279   public void setOnclick(final javax.el.ValueExpression onclick) {
280     this.onclick = onclick;
281   }
282 
283   public javax.el.ValueExpression getDisabled() {
284     return disabled;
285   }
286 
287   public void setDisabled(final javax.el.ValueExpression disabled) {
288     this.disabled = disabled;
289   }
290 
291 
292 
293   @Override
294   public void release() {
295     super.release();
296     actionListener = null;
297     accessKey = null;
298     link = null;
299     labelWithAccessKey = null;
300     resource = null;
301     jsfResource = null;
302     image = null;
303     transition = null;
304     label = null;
305     tip = null;
306     immediate = null;
307     value = null;
308     action = null;
309     target = null;
310     renderedPartially = null;
311     onclick = null;
312     disabled = null;
313   }
314 }