org.spiffyui.client.widgets.slider
Class RangeSlider

java.lang.Object
  extended by Widget
      extended by org.spiffyui.client.widgets.slider.Slider
          extended by org.spiffyui.client.widgets.slider.RangeSlider

public class RangeSlider
extends Slider

RangeSlider is a convenient sub class of Slider for showing ranges.

CSS Style Ryles


Constructor Summary
RangeSlider(java.lang.String id, int min, int max, int defaultMin, int defaultMax)
          Constructor for the RangeSlider
 
Method Summary
static JSONObject getOptions(int min, int max, int defaultMin, int defaultMax)
          A convenient way to create an options JSONObject for the RangeSlider.
 int getValueMax()
          Convenience method for when range is true, gets the maximum of the selected range, or in other words, gets the value of the higher anchor
 int getValueMin()
          Convenience method for when range is true, gets the minimum of the selected range, or in other words, gets the value of the lower anchor
protected  void onLoad()
           
 void setValues(int min, int max)
          Convenience method for when range is true, sets both the min and max anchors
 
Methods inherited from class org.spiffyui.client.widgets.slider.Slider
addListener, getBooleanOption, getIntOption, getMaximum, getMinimum, getOptions, getStringOption, getValue, getValueAtIndex, onUnload, removeListener, setBooleanOption, setIntOption, setMaximum, setMinimum, setStringOption, setStringOption, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeSlider

public RangeSlider(java.lang.String id,
                   int min,
                   int max,
                   int defaultMin,
                   int defaultMax)
Constructor for the RangeSlider

Parameters:
id - - element ID
min - - the minimum possible value of the slider
max - - the maximum possible value of the slider
defaultMin - - the default value of the lowest anchor
defaultMax - - the default value of the highest anchor
Method Detail

getOptions

public static JSONObject getOptions(int min,
                                    int max,
                                    int defaultMin,
                                    int defaultMax)
A convenient way to create an options JSONObject for the RangeSlider.

Parameters:
min - - default minimum of the slider
max - - default maximum of the slider
defaultMin - - the default value of the lowest anchor
defaultMax - - the default value of the highest anchor
Returns:
a JSONObject of RangeSlider options

getValueMin

public int getValueMin()
Convenience method for when range is true, gets the minimum of the selected range, or in other words, gets the value of the lower anchor

Returns:
the value

getValueMax

public int getValueMax()
Convenience method for when range is true, gets the maximum of the selected range, or in other words, gets the value of the higher anchor

Returns:
the value

setValues

public void setValues(int min,
                      int max)
Convenience method for when range is true, sets both the min and max anchors

Parameters:
min - - the lower anchor's value
max - - the upper anchor's value

onLoad

protected void onLoad()
Overrides:
onLoad in class Slider