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