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.UITreeCommand;
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.TreeCommandTagDeclaration}.
33   */
34  public final class TreeCommandTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TreeCommandTag.class);
36    private javax.el.MethodExpression  actionListener;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  link;
39    private javax.el.ValueExpression  tabIndex;
40    private javax.el.ValueExpression  tip;
41    private javax.el.ValueExpression  inline;
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  label;
47    private javax.el.ValueExpression  immediate;
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 UITreeCommand.COMPONENT_TYPE;
56    }
57    @Override
58    public String getRendererType() {
59      return "TreeCommand";
60    }
61  
62    @Override
63    protected void setProperties(final UIComponent uiComponent) {
64      super.setProperties(uiComponent);
65      final UITreeCommand component = (UITreeCommand) 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 (link != null) {
79        component.setValueExpression("link", link);
80      }
81  
82      if (tabIndex != null) {
83        if (!tabIndex.isLiteralText()) {
84          component.setValueExpression("tabIndex", tabIndex);
85        } else {
86          component.setTabIndex(Integer.parseInt(tabIndex.getExpressionString()));
87        }
88      }
89      if (tip != null) {
90        component.setValueExpression("tip", tip);
91      }
92  
93      if (inline != null) {
94        if (!inline.isLiteralText()) {
95          component.setValueExpression("inline", inline);
96        } else {
97          component.setInline(Boolean.parseBoolean(inline.getExpressionString()));
98        }
99      }
100     if (action != null) {
101       component.setActionExpression(action);
102     }
103     if (jsfResource != null) {
104       if (!jsfResource.isLiteralText()) {
105         component.setValueExpression("jsfResource", jsfResource);
106       } else {
107         component.setJsfResource(Boolean.parseBoolean(jsfResource.getExpressionString()));
108       }
109     }
110     if (resource != null) {
111       component.setValueExpression("resource", resource);
112     }
113 
114     if (transition != null) {
115       if (!transition.isLiteralText()) {
116         component.setValueExpression("transition", transition);
117       } else {
118         component.setTransition(Boolean.parseBoolean(transition.getExpressionString()));
119       }
120     }
121     if (label != null) {
122       component.setValueExpression("label", label);
123     }
124 
125     if (immediate != null) {
126       if (!immediate.isLiteralText()) {
127         component.setValueExpression("immediate", immediate);
128       } else {
129         component.setImmediate(Boolean.parseBoolean(immediate.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 getLink() {
173     return link;
174   }
175 
176   public void setLink(final javax.el.ValueExpression link) {
177     this.link = link;
178   }
179 
180   public javax.el.ValueExpression getTabIndex() {
181     return tabIndex;
182   }
183 
184   public void setTabIndex(final javax.el.ValueExpression tabIndex) {
185     this.tabIndex = tabIndex;
186   }
187 
188   public javax.el.ValueExpression getTip() {
189     return tip;
190   }
191 
192   public void setTip(final javax.el.ValueExpression tip) {
193     this.tip = tip;
194   }
195 
196   public javax.el.ValueExpression getInline() {
197     return inline;
198   }
199 
200   public void setInline(final javax.el.ValueExpression inline) {
201     this.inline = inline;
202   }
203 
204   public javax.el.MethodExpression getAction() {
205     return action;
206   }
207 
208   public void setAction(final javax.el.MethodExpression action) {
209     this.action = action;
210   }
211 
212   public javax.el.ValueExpression getJsfResource() {
213     return jsfResource;
214   }
215 
216   public void setJsfResource(final javax.el.ValueExpression jsfResource) {
217     this.jsfResource = jsfResource;
218   }
219 
220   public javax.el.ValueExpression getResource() {
221     return resource;
222   }
223 
224   public void setResource(final javax.el.ValueExpression resource) {
225     this.resource = resource;
226   }
227 
228   public javax.el.ValueExpression getTransition() {
229     return transition;
230   }
231 
232   public void setTransition(final javax.el.ValueExpression transition) {
233     this.transition = transition;
234   }
235 
236   public javax.el.ValueExpression getLabel() {
237     return label;
238   }
239 
240   public void setLabel(final javax.el.ValueExpression label) {
241     this.label = label;
242   }
243 
244   public javax.el.ValueExpression getImmediate() {
245     return immediate;
246   }
247 
248   public void setImmediate(final javax.el.ValueExpression immediate) {
249     this.immediate = immediate;
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     link = null;
292     tabIndex = null;
293     tip = null;
294     inline = null;
295     action = null;
296     jsfResource = null;
297     resource = null;
298     transition = null;
299     label = null;
300     immediate = null;
301     renderedPartially = null;
302     target = null;
303     onclick = null;
304     disabled = null;
305   }
306 }