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.component.behavior.ClientBehaviorHolder;
23  import javax.faces.context.FacesContext;
24  import org.apache.myfaces.tobago.context.Markup;
25  import org.apache.myfaces.tobago.internal.component.AbstractUITreeListbox;
26  import org.apache.myfaces.tobago.model.Selectable;
27  import org.apache.myfaces.tobago.renderkit.css.CustomClass;
28  import org.apache.myfaces.tobago.renderkit.css.Style;
29  import org.apache.myfaces.tobago.internal.util.ArrayUtils;
30  import org.apache.myfaces.tobago.internal.util.StringUtils;
31  import org.apache.myfaces.tobago.internal.util.Deprecation;
32  import javax.el.ELException;
33  import javax.faces.FacesException;
34  import java.util.Arrays;
35  import java.util.ArrayList;
36  import java.util.Collection;
37  import java.util.List;
38  import javax.el.MethodExpression;
39  import javax.el.ValueExpression;
40  
41  /** 
42   A tree data structure displayed as a set of list boxes.
43    * UIComponent class, generated from template {@code component.stg} with class
44    * {@link org.apache.myfaces.tobago.internal.taglib.component.TreeListboxTagDeclaration}.
45   */
46  public class UITreeListbox
47      extends AbstractUITreeListbox implements ClientBehaviorHolder, Visual {
48  
49    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.TreeListbox";
50  
51    public static final String COMPONENT_FAMILY = "javax.faces.Data";
52  
53  
54    enum PropertyKeys {
55      markup,
56      size,
57      selectable,
58      customClass,
59      style,
60      required,
61    }
62  
63    public String getFamily() {
64      return COMPONENT_FAMILY;
65    }
66  
67  
68    public org.apache.myfaces.tobago.context.Markup getMarkup() {
69      Object object = getStateHelper().eval(PropertyKeys.markup);
70      if (object != null) {
71        return Markup.valueOf(object);
72      }
73      return null;
74    }
75  
76    public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
77      getStateHelper().put(PropertyKeys.markup, markup);
78    }
79  
80    /**
81    The number of the shown rows in the element. E. g. the size attribute of the select element in HTML.
82  
83    */
84    public java.lang.Integer getSize() {
85      Number value  = (Number) getStateHelper().eval(PropertyKeys.size);
86      if (value != null) {
87        return value.intValue();
88      }
89      return null;
90    }
91  
92    public void setSize(java.lang.Integer size) {
93      getStateHelper().put(PropertyKeys.size, size);
94    }
95  
96    /**
97    Flag indicating whether or not this component should be render selectable items.
98     Possible values are:
99     <ul>
100    <li><strong>single</strong> : a single section tree is rendered</li>
101    <li><strong>multiLeafOnly</strong> : a multi section tree is rendered,
102    only Leaf's are selectable</li>
103    <li><strong>singleLeafOnly</strong> : a single section tree is rendered,
104    only Leaf's are selectable</li>
105    </ul>
106   <br>Default: <code>single</code><br>Allowed Values: <code>single,multiLeafOnly,singleLeafOnly</code>
107   */
108   public org.apache.myfaces.tobago.model.Selectable getSelectable() {
109     org.apache.myfaces.tobago.model.Selectable selectable = (org.apache.myfaces.tobago.model.Selectable) getStateHelper().eval(PropertyKeys.selectable);
110     if (selectable != null) {
111       return selectable;
112     }
113     return org.apache.myfaces.tobago.model.Selectable.single;
114   }
115 
116   public void setSelectable(org.apache.myfaces.tobago.model.Selectable selectable) {
117     getStateHelper().put(PropertyKeys.selectable, selectable);
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   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
147 
148   */
149   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
150     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
151   }
152 
153   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
154     getStateHelper().put(PropertyKeys.style, style);
155   }
156 
157   /**
158   Flag indicating that a value is required.
159    If the value is an empty string a
160    ValidationError occurs and a Error Message is rendered.
161   <br>Default: <code>false</code>
162   */
163   public boolean isRequired() {
164     Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.required);
165     if (bool != null) {
166       return bool;
167     }
168     return false;
169   }
170 
171   public void setRequired(boolean required) {
172     getStateHelper().put(PropertyKeys.required, required);
173   }
174 
175 
176 }