|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectWidget
org.spiffyui.client.widgets.slider.Slider
public class Slider
This widget wraps the JQuery UI Slider and allows for single slider or double slider with range. All options can be get or set using generic get/setIntOption, get/setStringOption, get/setBooleanOption methods, but some convenience methods are provided for most popular such as setValues and setMinimum and setMaximum. See SliderOptions for full list of options.
SliderOption
Constructor Summary | |
---|---|
Slider(java.lang.String id)
Create the default slider with the specified ID. |
|
Slider(java.lang.String id,
int min,
int max,
int defaultValue)
Create a slider with the specified ID. |
|
Slider(java.lang.String id,
int min,
int max,
int[] defaultValues)
Create a slider with the specified ID. |
|
Slider(java.lang.String id,
JSONObject options)
Create a slider with the specified ID. |
Method Summary | |
---|---|
void |
addListener(SliderListener l)
Add a SliderListener |
boolean |
getBooleanOption(SliderOption option)
Get an option boolean value |
int |
getIntOption(SliderOption option)
Get an option numeric value |
int |
getMaximum()
Gets the maximum possible value for the slider |
int |
getMinimum()
Gets the minimum possible value for the slider |
static JSONObject |
getOptions(int min,
int max,
int[] defaultValues)
A convenient way to create an options JSONObject. |
java.lang.String |
getStringOption(SliderOption option)
Set an option string value |
int |
getValue()
Convenience method for only 1 anchor |
int |
getValueAtIndex(int index)
Gets the value of a anchor at the specified index |
protected void |
onLoad()
|
protected void |
onUnload()
|
void |
removeListener(SliderListener l)
Removes the SliderListener |
void |
setBooleanOption(SliderOption option,
boolean value)
Set an option boolean value |
void |
setIntOption(SliderOption option,
int value)
Set an option numeric value |
void |
setMaximum(int maximum)
Sets the maximum possible value for the slider |
void |
setMinimum(int minimum)
Sets the minimum possible value for the slider |
java.lang.String |
setStringOption(SliderOption option)
Deprecated. - typo, in future releases this will be removed. Use getStringOption(SliderOption option) |
void |
setStringOption(SliderOption option,
java.lang.String value)
Set an option string value |
void |
setValue(int value)
Convenience method for only 1 anchor |
void |
setValues(int[] values)
Sets the value of each anchor |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Slider(java.lang.String id, int min, int max, int defaultValue)
id
- - id of the elementmin
- - default minimum of the slidermax
- - default maximum of the sliderdefaultValue
- - default point of a single anchorpublic Slider(java.lang.String id, int min, int max, int[] defaultValues)
id
- - id of the elementmin
- - default minimum of the slidermax
- - default maximum of the sliderdefaultValues
- - default points of each anchorpublic Slider(java.lang.String id)
id
- - id of the element to createpublic Slider(java.lang.String id, JSONObject options)
id
- - id of the element to createoptions
- - JSONObject of any possible option, can be null for defaultsMethod Detail |
---|
public static JSONObject getOptions(int min, int max, int[] defaultValues)
min
- - default minimum of the slidermax
- - default maximum of the sliderdefaultValues
- - default points of each anchor
protected void onLoad()
protected void onUnload()
public int getMinimum()
public void setMinimum(int minimum)
minimum
- The minimum to set.public int getMaximum()
public void setMaximum(int maximum)
maximum
- The maximum to set.public int getValue()
public void setValue(int value)
value
- to set.public void setValues(int[] values)
values
- - int array of valuespublic int getValueAtIndex(int index)
index
- the index to retreive the value for
public void setIntOption(SliderOption option, int value)
option
- the SliderOptionvalue
- the numericpublic int getIntOption(SliderOption option)
option
- the SliderOption
public void setBooleanOption(SliderOption option, boolean value)
option
- the SliderOptionvalue
- the booleanpublic boolean getBooleanOption(SliderOption option)
option
- the SliderOption
public void setStringOption(SliderOption option, java.lang.String value)
option
- the SliderOptionvalue
- the String@Deprecated public java.lang.String setStringOption(SliderOption option)
option
- the SliderOption
public java.lang.String getStringOption(SliderOption option)
option
- the SliderOption
public void addListener(SliderListener l)
l
- - SliderListenerpublic void removeListener(SliderListener l)
l
- - SliderListener
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |