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