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