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.UIMenuCommand;
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.MenuCommandTagDeclaration}.
33   */
34  public final class MenuCommandTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(MenuCommandTag.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.MethodExpression  action;
41    private javax.el.ValueExpression  jsfResource;
42    private javax.el.ValueExpression  resource;
43    private javax.el.ValueExpression  image;
44    private javax.el.ValueExpression  transition;
45    private javax.el.ValueExpression  label;
46    private javax.el.ValueExpression  immediate;
47    private javax.el.ValueExpression  omit;
48    private javax.el.ValueExpression  renderedPartially;
49    private javax.el.ValueExpression  target;
50    private javax.el.ValueExpression  onclick;
51    private javax.el.ValueExpression  disabled;
52  
53    @Override
54    public String getComponentType() {
55      return UIMenuCommand.COMPONENT_TYPE;
56    }
57    @Override
58    public String getRendererType() {
59      return "MenuCommand";
60    }
61  
62    @Override
63    protected void setProperties(final UIComponent uiComponent) {
64      super.setProperties(uiComponent);
65      final UIMenuCommand component = (UIMenuCommand) uiComponent;
66      final FacesContext context = FacesContext.getCurrentInstance();
67      final Application application = context.getApplication();
68      if (actionListener != null) {
69        component.addActionListener(new javax.faces.event.MethodExpressionActionListener(actionListener));
70      }
71      if (markup != null) {
72        if (!markup.isLiteralText()) {
73          component.setValueExpression("markup", markup);
74        } else {
75          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
76        }
77      }
78      if (accessKey != null) {
79        if (!accessKey.isLiteralText()) {
80          component.setValueExpression("accessKey", accessKey);
81        } else {
82          component.setAccessKey(accessKey.getExpressionString().charAt(0));
83        }
84      }
85      if (link != null) {
86        component.setValueExpression("link", link);
87      }
88  
89      if (action != null) {
90        component.setActionExpression(action);
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 (resource != null) {
100       component.setValueExpression("resource", resource);
101     }
102 
103     if (image != null) {
104       component.setValueExpression("image", image);
105     }
106 
107     if (transition != null) {
108       if (!transition.isLiteralText()) {
109         component.setValueExpression("transition", transition);
110       } else {
111         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
112       }
113     }
114     if (label != null) {
115       component.setValueExpression("label", label);
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 (renderedPartially != null) {
133       if (!renderedPartially.isLiteralText()) {
134         component.setValueExpression("renderedPartially", renderedPartially);
135       } else {
136         component.setRenderedPartially(splitList(renderedPartially.getExpressionString()));
137       }
138     }
139     if (target != null) {
140       component.setValueExpression("target", target);
141     }
142 
143     if (onclick != null) {
144       component.setValueExpression("onclick", onclick);
145     }
146 
147     if (disabled != null) {
148       if (!disabled.isLiteralText()) {
149         component.setValueExpression("disabled", disabled);
150       } else {
151         component.setDisabled(Boolean.parseBoolean(disabled.getExpressionString()));
152       }
153     }
154   }
155 
156   public javax.el.MethodExpression getActionListener() {
157     return actionListener;
158   }
159 
160   public void setActionListener(final javax.el.MethodExpression actionListener) {
161     this.actionListener = actionListener;
162   }
163 
164   public javax.el.ValueExpression getMarkup() {
165     return markup;
166   }
167 
168   public void setMarkup(final javax.el.ValueExpression markup) {
169     this.markup = markup;
170   }
171 
172   public javax.el.ValueExpression getAccessKey() {
173     return accessKey;
174   }
175 
176   public void setAccessKey(final javax.el.ValueExpression accessKey) {
177     this.accessKey = accessKey;
178   }
179 
180   public javax.el.ValueExpression getLink() {
181     return link;
182   }
183 
184   public void setLink(final javax.el.ValueExpression link) {
185     this.link = link;
186   }
187 
188   public javax.el.MethodExpression getAction() {
189     return action;
190   }
191 
192   public void setAction(final javax.el.MethodExpression action) {
193     this.action = action;
194   }
195 
196   public javax.el.ValueExpression getJsfResource() {
197     return jsfResource;
198   }
199 
200   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
201     this.jsfResource = jsfResource;
202   }
203 
204   public javax.el.ValueExpression getResource() {
205     return resource;
206   }
207 
208   public void setResource(final javax.el.ValueExpression resource) {
209     this.resource = resource;
210   }
211 
212   public javax.el.ValueExpression getImage() {
213     return image;
214   }
215 
216   public void setImage(final javax.el.ValueExpression image) {
217     this.image = image;
218   }
219 
220   public javax.el.ValueExpression getTransition() {
221     return transition;
222   }
223 
224   public void setTransition(final javax.el.ValueExpression transition) {
225     this.transition = transition;
226   }
227 
228   public javax.el.ValueExpression getLabel() {
229     return label;
230   }
231 
232   public void setLabel(final javax.el.ValueExpression label) {
233     this.label = label;
234   }
235 
236   public javax.el.ValueExpression getImmediate() {
237     return immediate;
238   }
239 
240   public void setImmediate(final javax.el.ValueExpression immediate) {
241     this.immediate = immediate;
242   }
243 
244   public javax.el.ValueExpression getOmit() {
245     return omit;
246   }
247 
248   public void setOmit(final javax.el.ValueExpression omit) {
249     this.omit = omit;
250   }
251 
252   public javax.el.ValueExpression getRenderedPartially() {
253     return renderedPartially;
254   }
255 
256   public void setRenderedPartially(final javax.el.ValueExpression renderedPartially) {
257     this.renderedPartially = renderedPartially;
258   }
259 
260   public javax.el.ValueExpression getTarget() {
261     return target;
262   }
263 
264   public void setTarget(final javax.el.ValueExpression target) {
265     this.target = target;
266   }
267 
268   public javax.el.ValueExpression getOnclick() {
269     return onclick;
270   }
271 
272   public void setOnclick(final javax.el.ValueExpression onclick) {
273     this.onclick = onclick;
274   }
275 
276   public javax.el.ValueExpression getDisabled() {
277     return disabled;
278   }
279 
280   public void setDisabled(final javax.el.ValueExpression disabled) {
281     this.disabled = disabled;
282   }
283 
284 
285 
286   @Override
287   public void release() {
288     super.release();
289     actionListener = null;
290     markup = null;
291     accessKey = null;
292     link = null;
293     action = null;
294     jsfResource = null;
295     resource = null;
296     image = null;
297     transition = null;
298     label = null;
299     immediate = null;
300     omit = null;
301     renderedPartially = null;
302     target = null;
303     onclick = null;
304     disabled = null;
305   }
306 }