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