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