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.component;
21  
22  import javax.faces.context.FacesContext;
23  import org.apache.myfaces.tobago.context.Markup;
24  import org.apache.myfaces.tobago.internal.component.AbstractUITreeSelect;
25  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
26  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
27  import org.apache.myfaces.tobago.internal.util.StringUtils;
28  import org.apache.myfaces.tobago.internal.util.Deprecation;
29  import org.apache.myfaces.tobago.component.Tags;
30  import javax.annotation.Generated;
31  import javax.el.ELException;
32  import javax.faces.FacesException;
33  import java.util.Arrays;
34  import java.util.ArrayList;
35  import java.util.Collection;
36  import java.util.List;
37  import javax.el.MethodExpression;
38  import javax.el.ValueExpression;
39  
40  /**
41   Makes a tree node selectable.
42    * UIComponent class, generated from template {@code component.stg} with class
43    * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeSelectTagDeclaration}.
44   */
45  @Generated("component.stg")
46  public class UITreeSelect
47      extends AbstractUITreeSelect  {
48  
49    public static final String COMPONENT_TYPE = Tags.treeSelect.componentType();
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.SelectBoolean";
52  
53    private static final Collection<String> EVENT_NAMES = Arrays.asList("change", "click", "dblclick", "focus", "blur");
54  
55    @Override
56    public Collection<String> getEventNames() {
57      return EVENT_NAMES;
58    }
59  
60    @Override
61    public String getDefaultEventName() {
62      return "change";
63    }
64  
65  
66    enum PropertyKeys {
67      markup,
68      label,
69      showCheckbox,
70      customClass,
71      tip,
72      disabled,
73    }
74  
75    public String getFamily() {
76      return COMPONENT_FAMILY;
77    }
78  
79  
80    public org.apache.myfaces.tobago.context.Markup getMarkup() {
81      Object object = getStateHelper().eval(PropertyKeys.markup);
82      if (object != null) {
83        return Markup.valueOf(object);
84      }
85      return null;
86    }
87  
88    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
89      getStateHelper().put(PropertyKeys.markup, markup);
90    }
91  
92    /**
93    A localized user presentable label for this component.
94  
95    */
96    public java.lang.String getLabel() {
97      return (java.lang.String) getStateHelper().eval(PropertyKeys.label);
98    }
99  
100   public void setLabel(java.lang.String label) {
101     getStateHelper().put(PropertyKeys.label, label);
102   }
103 
104   /**
105   Show a checkbox to visualize the selection state.
106    This is useful to hide the checkbox, e. g. dependent of the type of the node.
107   <br>Default: <code>true</code>
108   */
109   public boolean isShowCheckbox() {
110     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.showCheckbox);
111     if (bool != null) {
112       return bool;
113     }
114     return true;
115   }
116 
117   public void setShowCheckbox(boolean showCheckbox) {
118     getStateHelper().put(PropertyKeys.showCheckbox, showCheckbox);
119   }
120 
121   /**
122   Sets a CSS class in its parent, if the parent supports it.
123 
124    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
125 
126    <pre>
127    &lt;tc:in&gt;
128      &lt;tc:style customClass="my-emphasized"/&gt;
129    &lt;/tc:in&gt;
130    </pre>
131 
132    One capability is, to used external CSS libs.
133    <br>
134    This feature should not be used imprudent.
135    Because it might be unstable against changes in the renderered HTML code.
136 
137   */
138   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
139     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
140   }
141 
142   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
143     getStateHelper().put(PropertyKeys.customClass, customClass);
144   }
145 
146   /**
147   Text value to display as tooltip.
148 
149   */
150   public java.lang.String getTip() {
151     return (java.lang.String) getStateHelper().eval(PropertyKeys.tip);
152   }
153 
154   public void setTip(java.lang.String tip) {
155     getStateHelper().put(PropertyKeys.tip, tip);
156   }
157 
158   /**
159   Flag indicating that this element is disabled.
160   <br>Default: <code>false</code>
161   */
162   public boolean isDisabled() {
163     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.disabled);
164     if (bool != null) {
165       return bool;
166     }
167     return false;
168   }
169 
170   public void setDisabled(boolean disabled) {
171     getStateHelper().put(PropertyKeys.disabled, disabled);
172   }
173 
174 
175   @Override
176   public void restoreState(FacesContext context, Object state) {
177     // FIXME HACK for mojarra SystemEventListener state restoring bug
178     pushComponentToEL(context, this);
179     super.restoreState(context, state);
180     popComponentFromEL(context);
181   }
182 
183 }