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.UITreeListbox;
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.TreeListboxTagDeclaration}.
33   */
34  public final class TreeListboxTag extends TobagoELTag {
35    private static final Logger LOG = LoggerFactory.getLogger(TreeListboxTag.class);
36    private javax.el.ValueExpression  markup;
37    private String var;
38    private javax.el.ValueExpression  state;
39    private javax.el.ValueExpression  value;
40    private javax.el.ValueExpression  required;
41    private javax.el.ValueExpression  selectable;
42  
43    @Override
44    public String getComponentType() {
45      return UITreeListbox.COMPONENT_TYPE;
46    }
47    @Override
48    public String getRendererType() {
49      return "TreeListbox";
50    }
51  
52    @Override
53    protected void setProperties(final UIComponent uiComponent) {
54      super.setProperties(uiComponent);
55      final UITreeListbox component = (UITreeListbox) uiComponent;
56      final FacesContext context = FacesContext.getCurrentInstance();
57      final Application application = context.getApplication();
58      if (markup != null) {
59        if (!markup.isLiteralText()) {
60          component.setValueExpression("markup", markup);
61        } else {
62          component.setMarkup(org.apache.myfaces.tobago.context.Markup.valueOf(markup.getExpressionString()));
63        }
64      }
65      if (var != null) {
66        component.setVar(var);
67      }
68  
69      if (state != null) {
70        if (!state.isLiteralText()) {
71          component.setValueExpression("state", state);
72        /*} else {
73          component.setState(state.getExpressionString());*/
74        }
75      }
76      if (value != null) {
77        component.setValueExpression("value", value);
78      }
79  
80      if (required != null) {
81        if (!required.isLiteralText()) {
82          component.setValueExpression("required", required);
83        } else {
84          component.setRequired(Boolean.parseBoolean(required.getExpressionString()));
85        }
86      }
87      if (selectable != null) {
88        component.setValueExpression("selectable", selectable);
89      }
90  
91    }
92  
93    public javax.el.ValueExpression getMarkup() {
94      return markup;
95    }
96  
97    public void setMarkup(final javax.el.ValueExpression markup) {
98      this.markup = markup;
99    }
100 
101   public String getVar() {
102     return var;
103   }
104 
105   public void setVar(final String var) {
106     this.var = var;
107   }
108 
109   public javax.el.ValueExpression getState() {
110     return state;
111   }
112 
113   public void setState(final javax.el.ValueExpression state) {
114     this.state = state;
115   }
116 
117   public javax.el.ValueExpression getValue() {
118     return value;
119   }
120 
121   public void setValue(final javax.el.ValueExpression value) {
122     this.value = value;
123   }
124 
125   public javax.el.ValueExpression getRequired() {
126     return required;
127   }
128 
129   public void setRequired(final javax.el.ValueExpression required) {
130     this.required = required;
131   }
132 
133   public javax.el.ValueExpression getSelectable() {
134     return selectable;
135   }
136 
137   public void setSelectable(final javax.el.ValueExpression selectable) {
138     this.selectable = selectable;
139   }
140 
141 
142 
143   @Override
144   public void release() {
145     super.release();
146     markup = null;
147     var = null;
148     state = null;
149     value = null;
150     required = null;
151     selectable = null;
152   }
153 }