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