Interface ISlider
-
- All Superinterfaces:
IAnyGroup<ISlider>
,IComponent<ISlider>
,IHtmlBasedComponent<ISlider>
,IXulElement<ISlider>
public interface ISlider extends IXulElement<ISlider>, IAnyGroup<ISlider>
ImmutableSlider
componentA slider component represents a slider with a scale and a knob. It can be used to let user select a value by sliding the knob along the scale. A slider accepts a range of value starting from 0 to certain maximum value. The default maximum value of slider scale is 100. You could change the maximum allowed value by the
maxpos
attribute. However the default minimum is 0 and cannot be changed.Support @Action
Name Action Type onScroll ActionData: ScrollData
Denotes the content of a scrollable component has been scrolled by the user.onScrolling ActionData: ScrollData
Denotes that the user is scrolling a scrollable component. Notice that the component's content (at the server) won't be changed until onScroll is received. Thus, you have to invoke thegetPos
method in the ScrollData class to retrieve the temporary position.Support Molds
Name Snapshot "default"
"sphere"
"scale"
"knob"
- Author:
- katherine
- See Also:
Slider
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ISlider.Builder
Builds instances of typeISlider
.static class
ISlider.Orient
Specifies the orient ofISlider
componentstatic class
ISlider.Updater
Builds an updater of typeISlider
forUiAgent.smartUpdate(Locator, SmartUpdater)
.
-
Field Summary
Fields Modifier and Type Field Description static ISlider
DEFAULT
Constant for default attributes of this immutable component.static ISlider
KNOB
Constant for knob mold attributes of this immutable component.static ISlider
SCALE
Constant for scale mold attributes of this immutable component.static ISlider
SPHERE
Constant for sphere mold attributes of this immutable component.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default double
getAngleArc()
Returns the degree of arc of the knob slider.default int
getCurpos()
Returns the current position of the slider.default double
getCurposInDouble()
Returns the double value of slider's current position.default int
getMaxpos()
Returns the value of slider's maximum position.default double
getMaxposInDouble()
Returns the double value of slider's maximum position.default int
getMinpos()
Returns the minimum position of the slider.default double
getMinposInDouble()
Returns the double value of slider's minimum position.java.lang.String
getName()
Returns the name of this component.default java.lang.String
getOrient()
Returns the orient.default int
getPageIncrement()
Returns the amount that the value ofgetCurpos()
changes by when the tray of the scroll bar is clicked.default double
getPageIncrementInDouble()
Returns the amount that the value ofgetCurpos()
changes by when the tray of the scroll bar is clicked.default double
getScaleInput()
Returns the scale ratio of the input in knob mold.default java.lang.String
getSlidingtext()
Returns the sliding text.default int
getStep()
Returns the step of sliderdefault double
getStepInDouble()
Returns the step of sliderdefault double
getStrokeWidth()
Returns the stroke width of the knob slider.default java.lang.String
getWidgetClass()
Returns the client widget class.static ISlider
ofId(java.lang.String id)
Returns the instance with the given id.ISlider
withAngleArc(double angleArc)
Returns a copy ofthis
immutable component with the specifiedangleArc
.default ISlider
withCurpos(double curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.default ISlider
withCurpos(int curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.ISlider
withCurposInDouble(double curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.default ISlider
withMaxpos(double maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.default ISlider
withMaxpos(int maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.ISlider
withMaxposInDouble(double maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.default ISlider
withMinpos(double minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.default ISlider
withMinpos(int minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.ISlider
withMinposInDouble(double minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.ISlider
withName(java.lang.String name)
Returns a copy ofthis
immutable component with the specifiedname
.ISlider
withOrient(java.lang.String orient)
Returns a copy ofthis
immutable component with the specifiedorient
.default ISlider
withOrient(ISlider.Orient orient)
Returns a copy ofthis
immutable component with the specifiedorient
.default ISlider
withPageIncrement(double pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.default ISlider
withPageIncrement(int pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.ISlider
withPageIncrementInDouble(double pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.ISlider
withScaleInput(double scaleInput)
Returns a copy ofthis
immutable component with the specifiedscaleInput
.ISlider
withSlidingtext(java.lang.String slidingtext)
Returns a copy ofthis
immutable component with the specifiedslidingtext
.default ISlider
withStep(double step)
Returns a copy ofthis
immutable component with the specifiedstep
.default ISlider
withStep(int step)
Returns a copy ofthis
immutable component with the specifiedstep
.ISlider
withStepInDouble(double step)
Returns a copy ofthis
immutable component with the specifiedstep
.ISlider
withStrokeWidth(double strokeWidth)
Returns a copy ofthis
immutable component with the specifiedstrokeWidth
.-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final ISlider DEFAULT
Constant for default attributes of this immutable component.
-
SPHERE
static final ISlider SPHERE
Constant for sphere mold attributes of this immutable component.
-
SCALE
static final ISlider SCALE
Constant for scale mold attributes of this immutable component.
-
KNOB
static final ISlider KNOB
Constant for knob mold attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.inp.Slider"
- Specified by:
getWidgetClass
in interfaceIComponent<ISlider>
- Returns:
-
getName
@Nullable java.lang.String getName()
Returns the name of this component.Default:
null
.
-
withName
ISlider withName(@Nullable java.lang.String name)
Returns a copy ofthis
immutable component with the specifiedname
.Sets the name of this component.
The name is used only to work with "legacy" Web application that handles user's request by servlets. It works only with HTTP/HTML-based browsers. It doesn't work with other kind of clients.
Don't use this method if your application is purely based on ZK's event-driven model.
- Parameters:
name
- The name of this component.Default:
null
.- Returns:
- A modified copy of the
this
object
-
getOrient
default java.lang.String getOrient()
Returns the orient.Default:
"horizontal"
.
-
withOrient
ISlider withOrient(java.lang.String orient)
Returns a copy ofthis
immutable component with the specifiedorient
.Sets the orient of component
- Parameters:
orient
- Either"horizontal"
or"vertical"
Default:
"horizontal"
.- Returns:
- A modified copy of the
this
object
-
withOrient
default ISlider withOrient(ISlider.Orient orient)
Returns a copy ofthis
immutable component with the specifiedorient
.Sets the orient of component
- Parameters:
orient
- Theorient
Default:
"horizontal"
.- Returns:
- A modified copy of the
this
object
-
getSlidingtext
default java.lang.String getSlidingtext()
Returns the sliding text.Default :
"{0}"
-
withSlidingtext
ISlider withSlidingtext(java.lang.String slidingtext)
Returns a copy ofthis
immutable component with the specifiedslidingtext
.Sets the sliding text.
- Parameters:
slidingtext
- The sliding text.Default:
"{0}"
.- Returns:
- A modified copy of the
this
object
-
getCurpos
@Lazy default int getCurpos()
Returns the current position of the slider.Default:
0
.
-
withCurpos
default ISlider withCurpos(int curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.Sets the current position of the slider.
- Parameters:
curpos
- The current position of the slider.Default:
0
.- Returns:
- A modified copy of the
this
object
-
withCurpos
default ISlider withCurpos(double curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.Sets the current position of the slider.
- Parameters:
curpos
- The current position of the slider.Default:
0.0
.- Returns:
- A modified copy of the
this
object
-
getCurposInDouble
default double getCurposInDouble()
Returns the double value of slider's current position.Default:
0.0
-
withCurposInDouble
ISlider withCurposInDouble(double curpos)
Returns a copy ofthis
immutable component with the specifiedcurpos
.Sets the current position of the slider.
- Parameters:
curpos
- The current position of the slider.Default:
0.0
.- Returns:
- A modified copy of the
this
object
-
getMinpos
@Lazy default int getMinpos()
Returns the minimum position of the slider.Default:
0
.
-
withMinpos
default ISlider withMinpos(int minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.Sets the value of slider's minimum position.
- Parameters:
minpos
- The value of slider's minimum position.Default:
0
.- Returns:
- A modified copy of the
this
object
-
withMinpos
default ISlider withMinpos(double minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.Sets the value of slider's minimum position.
- Parameters:
minpos
- The value of slider's minimum position.Default:
0.0
.- Returns:
- A modified copy of the
this
object
-
getMinposInDouble
default double getMinposInDouble()
Returns the double value of slider's minimum position.Default:
0.0
.
-
withMinposInDouble
ISlider withMinposInDouble(double minpos)
Returns a copy ofthis
immutable component with the specifiedminpos
.Sets the value of slider's minimum position.
- Parameters:
minpos
- The value of slider's minimum position.Default:
0.0
.- Returns:
- A modified copy of the
this
object
-
getMaxpos
@Lazy default int getMaxpos()
Returns the value of slider's maximum position.Default:
100
.
-
withMaxpos
default ISlider withMaxpos(int maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.Sets the value of slider's maximum position.
- Parameters:
maxpos
- The value of slider's minimum position.Default:
100
.- Returns:
- A modified copy of the
this
object
-
withMaxpos
default ISlider withMaxpos(double maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.Sets the value of slider's maximum position.
- Parameters:
maxpos
- The value of slider's minimum position.Default:
100.0
.- Returns:
- A modified copy of the
this
object
-
getMaxposInDouble
default double getMaxposInDouble()
Returns the double value of slider's maximum position.Default:
100.0
.
-
withMaxposInDouble
ISlider withMaxposInDouble(double maxpos)
Returns a copy ofthis
immutable component with the specifiedmaxpos
.Sets the value of slider's maximum position.
- Parameters:
maxpos
- The value of slider's maximum position.Default:
0.0
.- Returns:
- A modified copy of the
this
object
-
getStep
@Lazy default int getStep()
Returns the step of sliderDefault:
-1
(means it will scroll to the position the user clicks). Note: In "decimal" mode, the fraction part only contains one digit if step is -1.
-
withStep
default ISlider withStep(int step)
Returns a copy ofthis
immutable component with the specifiedstep
.Sets the step of slider
- Parameters:
step
- The step of sliderDefault:
-1
.- Returns:
- A modified copy of the
this
object
-
withStep
default ISlider withStep(double step)
Returns a copy ofthis
immutable component with the specifiedstep
.Sets the step of slider
- Parameters:
step
- The step of sliderDefault:
-1.0
.- Returns:
- A modified copy of the
this
object
-
getStepInDouble
default double getStepInDouble()
Returns the step of sliderDefault:
-1.0
(means it will scroll to the position the user clicks). Note: In "decimal" mode, the fraction part only contains one digit if step is -1.
-
withStepInDouble
ISlider withStepInDouble(double step)
Returns a copy ofthis
immutable component with the specifiedstep
.Sets the step of slider
- Parameters:
step
- The step of sliderDefault:
-1.0
.- Returns:
- A modified copy of the
this
object
-
getPageIncrement
@Lazy default int getPageIncrement()
Returns the amount that the value ofgetCurpos()
changes by when the tray of the scroll bar is clicked.Default:
-1
(means it will scroll to the position the user clicks).
-
withPageIncrement
default ISlider withPageIncrement(int pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.Sets the amount that the value of
getCurpos()
changes by when the tray of the scroll bar is clicked.- Parameters:
pageIncrement
- The page increment value of sliderDefault:
-1
.- Returns:
- A modified copy of the
this
object
-
withPageIncrement
default ISlider withPageIncrement(double pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.Sets the amount that the value of
getCurpos()
changes by when the tray of the scroll bar is clicked.- Parameters:
pageIncrement
- The page increment value of sliderDefault:
-1.0
.- Returns:
- A modified copy of the
this
object
-
getPageIncrementInDouble
default double getPageIncrementInDouble()
Returns the amount that the value ofgetCurpos()
changes by when the tray of the scroll bar is clicked.Default:
-1.0
(means it will scroll to the position the user clicks).
-
withPageIncrementInDouble
ISlider withPageIncrementInDouble(double pageIncrement)
Returns a copy ofthis
immutable component with the specifiedpageIncrement
.Sets the amount that the value of
getCurpos()
changes by when the tray of the scroll bar is clicked.- Parameters:
pageIncrement
- The page increment value of sliderDefault:
-1.0
.- Returns:
- A modified copy of the
this
object
-
getStrokeWidth
default double getStrokeWidth()
Returns the stroke width of the knob slider.Default:
10.0
-
withStrokeWidth
ISlider withStrokeWidth(double strokeWidth)
Returns a copy ofthis
immutable component with the specifiedstrokeWidth
.Sets the stroke width of the knob slider.
- Parameters:
strokeWidth
- The stroke width of the knob sliderDefault:
10.0
.- Returns:
- A modified copy of the
this
object
-
getAngleArc
default double getAngleArc()
Returns the degree of arc of the knob slider.Default:
360.0
-
withAngleArc
ISlider withAngleArc(double angleArc)
Returns a copy ofthis
immutable component with the specifiedangleArc
.Sets the degree of arc of the knob slider.
- Parameters:
angleArc
- The degree of arc of the knob slider.Default:
360.0
.- Returns:
- A modified copy of the
this
object
-
getScaleInput
default double getScaleInput()
Returns the scale ratio of the input in knob mold.Default:
1.0
-
withScaleInput
ISlider withScaleInput(double scaleInput)
Returns a copy ofthis
immutable component with the specifiedscaleInput
.Sets the scale ratio of the input in knob mold.
- Parameters:
scaleInput
- The scale ratio of the input in knob mold.Default:
1.0
.- Returns:
- A modified copy of the
this
object
-
ofId
static ISlider ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id
- The id to identify this component.
-
-