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.UISelectItem;
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.SelectItemTagDeclaration}.
33   */
34  public final class SelectItemTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(SelectItemTag.class);
36    private javax.el.ValueExpression  itemDescription;
37    private javax.el.ValueExpression  markup;
38    private javax.el.ValueExpression  itemValue;
39    private javax.el.ValueExpression  itemLabel;
40    private javax.el.ValueExpression  value;
41    private javax.el.ValueExpression  tip;
42    private javax.el.ValueExpression  itemImage;
43    private javax.el.ValueExpression  itemDisabled;
44  
45    @Override
46    public String getComponentType() {
47      return UISelectItem.COMPONENT_TYPE;
48    }
49    @Override
50    public String getRendererType() {
51      return null;
52    }
53  
54    @Override
55    protected void setProperties(final UIComponent uiComponent) {
56      super.setProperties(uiComponent);
57      final UISelectItem component = (UISelectItem) uiComponent;
58      final FacesContext context = FacesContext.getCurrentInstance();
59      final Application application = context.getApplication();
60      if (itemDescription != null) {
61        component.setValueExpression("itemDescription", itemDescription);
62      }
63  
64      if (markup != null) {
65        if (!markup.isLiteralText()) {
66          component.setValueExpression("markup", markup);
67        } else {
68          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
69        }
70      }
71      if (itemValue != null) {
72        component.setValueExpression("itemValue", itemValue);
73      }
74  
75      if (itemLabel != null) {
76        component.setValueExpression("itemLabel", itemLabel);
77      }
78  
79      if (value != null) {
80        if (!value.isLiteralText()) {
81          component.setValueExpression("value", value);
82        /*} else {
83          component.setValue(value.getExpressionString());*/
84        }
85      }
86      if (tip != null) {
87        component.setValueExpression("tip", tip);
88      }
89  
90      if (itemImage != null) {
91        component.setValueExpression("itemImage", itemImage);
92      }
93  
94      if (itemDisabled != null) {
95        if (!itemDisabled.isLiteralText()) {
96          component.setValueExpression("itemDisabled", itemDisabled);
97        } else {
98          component.setItemDisabled(Boolean.parseBoolean(itemDisabled.getExpressionString()));
99        }
100     }
101   }
102 
103   public javax.el.ValueExpression getItemDescription() {
104     return itemDescription;
105   }
106 
107   public void setItemDescription(final javax.el.ValueExpression itemDescription) {
108     this.itemDescription = itemDescription;
109   }
110 
111   public javax.el.ValueExpression getMarkup() {
112     return markup;
113   }
114 
115   public void setMarkup(final javax.el.ValueExpression markup) {
116     this.markup = markup;
117   }
118 
119   public javax.el.ValueExpression getItemValue() {
120     return itemValue;
121   }
122 
123   public void setItemValue(final javax.el.ValueExpression itemValue) {
124     this.itemValue = itemValue;
125   }
126 
127   public javax.el.ValueExpression getItemLabel() {
128     return itemLabel;
129   }
130 
131   public void setItemLabel(final javax.el.ValueExpression itemLabel) {
132     this.itemLabel = itemLabel;
133   }
134 
135   public javax.el.ValueExpression getValue() {
136     return value;
137   }
138 
139   public void setValue(final javax.el.ValueExpression value) {
140     this.value = value;
141   }
142 
143   public javax.el.ValueExpression getTip() {
144     return tip;
145   }
146 
147   public void setTip(final javax.el.ValueExpression tip) {
148     this.tip = tip;
149   }
150 
151   public javax.el.ValueExpression getItemImage() {
152     return itemImage;
153   }
154 
155   public void setItemImage(final javax.el.ValueExpression itemImage) {
156     this.itemImage = itemImage;
157   }
158 
159   public javax.el.ValueExpression getItemDisabled() {
160     return itemDisabled;
161   }
162 
163   public void setItemDisabled(final javax.el.ValueExpression itemDisabled) {
164     this.itemDisabled = itemDisabled;
165   }
166 
167 
168 
169   @Override
170   public void release() {
171     super.release();
172     itemDescription = null;
173     markup = null;
174     itemValue = null;
175     itemLabel = null;
176     value = null;
177     tip = null;
178     itemImage = null;
179     itemDisabled = null;
180   }
181 }