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