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