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.AbstractUINumberSlider;
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   <p>
41    WARNING: This component is preliminary and may be changed without a major release.
42    </p>
43  
44    Renders a slider to select a number in a range.
45    * UIComponent class, generated from template {@code component.stg} with class
46    * {@link org.apache.myfaces.tobago.internal.taglib.sandbox.NumberSliderTagDeclaration}.
47   */
48  public class UINumberSlider
49      extends AbstractUINumberSlider implements Visual {
50  
51    public static final String COMPONENT_TYPE = "org.apache.myfaces.tobago.NumberSlider";
52  
53    public static final String COMPONENT_FAMILY = "javax.faces.Input";
54  
55  
56    enum PropertyKeys {
57      min,
58      readonly,
59      markup,
60      max,
61      customClass,
62      disabled,
63      style,
64    }
65  
66    public String getFamily() {
67      return COMPONENT_FAMILY;
68    }
69  
70  
71    /**
72    The minimum integer that can be entered and which represents the left
73     border of the slider.
74    <br>Default: <code>0</code>
75    */
76    public java.lang.Integer getMin() {
77      Number value  = (Number) getStateHelper().eval(PropertyKeys.min);
78      if (value != null) {
79        return value.intValue();
80      }
81      return 0;
82    }
83  
84    public void setMin(java.lang.Integer min) {
85      getStateHelper().put(PropertyKeys.min, min);
86    }
87  
88    /**
89    Flag indicating that this component will prohibit changes by the user.
90    <br>Default: <code>false</code>
91    */
92    public boolean isReadonly() {
93      Boolean bool = (Boolean) getStateHelper().eval(PropertyKeys.readonly);
94      if (bool != null) {
95        return bool;
96      }
97      return false;
98    }
99  
100   public void setReadonly(boolean readonly) {
101     getStateHelper().put(PropertyKeys.readonly, readonly);
102   }
103 
104   public org.apache.myfaces.tobago.context.Markup getMarkup() {
105     Object object = getStateHelper().eval(PropertyKeys.markup);
106     if (object != null) {
107       return Markup.valueOf(object);
108     }
109     return null;
110   }
111 
112   public void setMarkup(org.apache.myfaces.tobago.context.Markup markup) {
113     getStateHelper().put(PropertyKeys.markup, markup);
114   }
115 
116   /**
117   The maximum integer that can be entered and which represents the right
118    border of the slider.
119   <br>Default: <code>100</code>
120   */
121   public java.lang.Integer getMax() {
122     Number value  = (Number) getStateHelper().eval(PropertyKeys.max);
123     if (value != null) {
124       return value.intValue();
125     }
126     return 100;
127   }
128 
129   public void setMax(java.lang.Integer max) {
130     getStateHelper().put(PropertyKeys.max, max);
131   }
132 
133   /**
134   Sets a CSS class in its parent, if the parent supports it.
135 
136    Which this feature it is possible to put a CSS class name into a component with the &lt;tc:style&gt; tag. Example:
137 
138    <pre>
139    &lt;tc:in&gt;
140      &lt;tc:style customClass="my-emphasized"/&gt;
141    &lt;/tc:in&gt;
142    </pre>
143 
144    One capability is, to used external CSS libs.
145    <br>
146    This feature should not be used imprudent.
147    Because it might be unstable against changes in the renderered HTML code.
148 
149   */
150   public org.apache.myfaces.tobago.renderkit.css.CustomClass getCustomClass() {
151     return (org.apache.myfaces.tobago.renderkit.css.CustomClass) getStateHelper().eval(PropertyKeys.customClass);
152   }
153 
154   public void setCustomClass(org.apache.myfaces.tobago.renderkit.css.CustomClass customClass) {
155     getStateHelper().put(PropertyKeys.customClass, customClass);
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   For internal use. Used for rendering, if there is a child tag &lt;tc:style&gt;
176 
177   */
178   public org.apache.myfaces.tobago.renderkit.css.Style getStyle() {
179     return (org.apache.myfaces.tobago.renderkit.css.Style) getStateHelper().eval(PropertyKeys.style);
180   }
181 
182   public void setStyle(org.apache.myfaces.tobago.renderkit.css.Style style) {
183     getStateHelper().put(PropertyKeys.style, style);
184   }
185 
186 
187 }