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