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