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