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