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