package org.dojotoolkit.faces.component; import java.io.Serializable; import javax.faces.component.UIComponentBase; import javax.faces.context.FacesContext; import javax.faces.el.ValueBinding; public class RangeSlider extends UIComponentBase implements Serializable { /** * */ private static final long serialVersionUID = -8625359125110062157L; /** *
The standard component type for this component.
*/ public static final String COMPONENT_TYPE = "org.dojotoolkit.faces.component.RangeSlider"; /** *The standard component family for this component.
*/ public static final String COMPONENT_FAMILY = "org.dojotoolkit.faces.component.RangeSlider"; public static final String DEFAULT_RENDERER_TYPE = "org.dojotoolkit.faces.RangeSliderRenderer"; public RangeSlider() { super(); setRendererType(DEFAULT_RENDERER_TYPE); } public String getRendererType() { return DEFAULT_RENDERER_TYPE; } private String min = "0"; private String max = "100"; private String low = "20"; private String high = "80"; private String style = "width:500px;"; private String discreteValues = "11"; private String ruleMarkers = "11"; public String getComponentType() { return COMPONENT_TYPE; } public String getMin() { ValueBinding vb = getValueBinding("min"); if (vb != null) { min = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return min; } public void setMin(String min) { this.min = min; ValueBinding vb = getValueBinding("min"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),min); } } public String getMax() { ValueBinding vb = getValueBinding("max"); if (vb != null) { max = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return max; } public void setMax(String max) { this.max = max; ValueBinding vb = getValueBinding("max"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),max); } } public String getLow() { ValueBinding vb = getValueBinding("low"); if (vb != null) { low = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return low; } public void setLow(String low) { this.low = low; ValueBinding vb = getValueBinding("low"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),low); } } public String getHigh() { ValueBinding vb = getValueBinding("high"); if (vb != null) { high = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return high; } public void setHigh(String high) { this.high = high; ValueBinding vb = getValueBinding("high"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),high); } } public String getStyle() { ValueBinding vb = getValueBinding("style"); if (vb != null) { style = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return style; } public void setStyle(String style) { this.style = style; ValueBinding vb = getValueBinding("style"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),style); } } public String getDiscreteValues() { ValueBinding vb = getValueBinding("discreteValues"); if (vb != null) { discreteValues = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return discreteValues; } public void setDiscreteValues(String discreteValues) { this.discreteValues = discreteValues; ValueBinding vb = getValueBinding("discreteValues"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),discreteValues); } } public String getRuleMarkers() { ValueBinding vb = getValueBinding("ruleMarkers"); if (vb != null) { ruleMarkers = vb.getValue(FacesContext.getCurrentInstance()).toString(); } return ruleMarkers; } public void setRuleMarkers(String ruleMarkers) { this.ruleMarkers = ruleMarkers; ValueBinding vb = getValueBinding("ruleMarkers"); if (vb != null) { vb.setValue(FacesContext.getCurrentInstance(),ruleMarkers); } } public String getFamily() { return (COMPONENT_FAMILY); } public Object saveState(FacesContext context) { Object[] state = new Object[8]; state[0] = super.saveState(context); state[1] = min; state[2] = max; state[3] = low; state[4] = high; state[5] = style; state[6] = discreteValues; state[7] = ruleMarkers; return state; } public void restoreState(FacesContext context, Object stateIn) { Object[] state = (Object[]) stateIn; super.restoreState(context, state[0]); min = (String) state[1]; max = (String) state[2]; low = (String) state[3]; high = (String) state[4]; style = (String) state[5]; discreteValues = (String) state[6]; ruleMarkers = (String) state[7]; } }