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  itemImage;
42    private javax.el.ValueExpression  itemDisabled;
43  
44    @Override
45    public String getComponentType() {
46      return UISelectItem.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 UISelectItem component = (UISelectItem) uiComponent;
57      final FacesContext context = FacesContext.getCurrentInstance();
58      final Application application = context.getApplication();
59      if (itemDescription != null) {
60        component.setValueExpression("itemDescription", itemDescription);
61      }
62  
63      if (markup != null) {
64        if (!markup.isLiteralText()) {
65          component.setValueExpression("markup", markup);
66        } else {
67          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
68        }
69      }
70      if (itemValue != null) {
71        component.setValueExpression("itemValue", itemValue);
72      }
73  
74      if (itemLabel != null) {
75        component.setValueExpression("itemLabel", itemLabel);
76      }
77  
78      if (value != null) {
79        if (!value.isLiteralText()) {
80          component.setValueExpression("value", value);
81        /*} else {
82          component.setValue(value.getExpressionString());*/
83        }
84      }
85      if (itemImage != null) {
86        component.setValueExpression("itemImage", itemImage);
87      }
88  
89      if (itemDisabled != null) {
90        if (!itemDisabled.isLiteralText()) {
91          component.setValueExpression("itemDisabled", itemDisabled);
92        } else {
93          component.setItemDisabled(Boolean.parseBoolean(itemDisabled.getExpressionString()));
94        }
95      }
96    }
97  
98    public javax.el.ValueExpression getItemDescription() {
99      return itemDescription;
100   }
101 
102   public void setItemDescription(final javax.el.ValueExpression itemDescription) {
103     this.itemDescription = itemDescription;
104   }
105 
106   public javax.el.ValueExpression getMarkup() {
107     return markup;
108   }
109 
110   public void setMarkup(final javax.el.ValueExpression markup) {
111     this.markup = markup;
112   }
113 
114   public javax.el.ValueExpression getItemValue() {
115     return itemValue;
116   }
117 
118   public void setItemValue(final javax.el.ValueExpression itemValue) {
119     this.itemValue = itemValue;
120   }
121 
122   public javax.el.ValueExpression getItemLabel() {
123     return itemLabel;
124   }
125 
126   public void setItemLabel(final javax.el.ValueExpression itemLabel) {
127     this.itemLabel = itemLabel;
128   }
129 
130   public javax.el.ValueExpression getValue() {
131     return value;
132   }
133 
134   public void setValue(final javax.el.ValueExpression value) {
135     this.value = value;
136   }
137 
138   public javax.el.ValueExpression getItemImage() {
139     return itemImage;
140   }
141 
142   public void setItemImage(final javax.el.ValueExpression itemImage) {
143     this.itemImage = itemImage;
144   }
145 
146   public javax.el.ValueExpression getItemDisabled() {
147     return itemDisabled;
148   }
149 
150   public void setItemDisabled(final javax.el.ValueExpression itemDisabled) {
151     this.itemDisabled = itemDisabled;
152   }
153 
154 
155 
156   @Override
157   public void release() {
158     super.release();
159     itemDescription = null;
160     markup = null;
161     itemValue = null;
162     itemLabel = null;
163     value = null;
164     itemImage = null;
165     itemDisabled = null;
166   }
167 }