Interface ISlider
- All Superinterfaces:
IAnyGroup<ISlider>,IComponent<ISlider>,IHtmlBasedComponent<ISlider>,IXulElement<ISlider>
Slider component
A 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 the getPos 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 ClassesModifier and TypeInterfaceDescriptionstatic classBuilds instances of typeISlider.static enumSpecifies the orient ofISlidercomponentstatic classBuilds an updater of typeISliderforUiAgent.smartUpdate(Locator, SmartUpdater). -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ISliderConstant for default attributes of this immutable component.static final ISliderConstant for knob mold attributes of this immutable component.static final ISliderConstant for scale mold attributes of this immutable component.static final ISliderConstant for sphere mold attributes of this immutable component. -
Method Summary
Modifier and TypeMethodDescriptiondefault doubleReturns the degree of arc of the knob slider.default intReturns the current position of the slider.default doubleReturns the double value of slider's current position.default intReturns the value of slider's maximum position.default doubleReturns the double value of slider's maximum position.default intReturns the minimum position of the slider.default doubleReturns the double value of slider's minimum position.getName()Returns the name of this component.default StringReturns the orient.default intReturns the amount that the value ofgetCurpos()changes by when the tray of the scroll bar is clicked.default doubleReturns the amount that the value ofgetCurpos()changes by when the tray of the scroll bar is clicked.default doubleReturns the scale ratio of the input in knob mold.default StringReturns the sliding text.default intgetStep()Returns the step of sliderdefault doubleReturns the step of sliderdefault doubleReturns the stroke width of the knob slider.default StringReturns the client widget class.static ISliderReturns the instance with the given id.withAngleArc(double angleArc) Returns a copy ofthisimmutable component with the specifiedangleArc.default ISliderwithCurpos(double curpos) Returns a copy ofthisimmutable component with the specifiedcurpos.default ISliderwithCurpos(int curpos) Returns a copy ofthisimmutable component with the specifiedcurpos.withCurposInDouble(double curpos) Returns a copy ofthisimmutable component with the specifiedcurpos.default ISliderwithMaxpos(double maxpos) Returns a copy ofthisimmutable component with the specifiedmaxpos.default ISliderwithMaxpos(int maxpos) Returns a copy ofthisimmutable component with the specifiedmaxpos.withMaxposInDouble(double maxpos) Returns a copy ofthisimmutable component with the specifiedmaxpos.default ISliderwithMinpos(double minpos) Returns a copy ofthisimmutable component with the specifiedminpos.default ISliderwithMinpos(int minpos) Returns a copy ofthisimmutable component with the specifiedminpos.withMinposInDouble(double minpos) Returns a copy ofthisimmutable component with the specifiedminpos.Returns a copy ofthisimmutable component with the specifiedname.withOrient(String orient) Returns a copy ofthisimmutable component with the specifiedorient.default ISliderwithOrient(ISlider.Orient orient) Returns a copy ofthisimmutable component with the specifiedorient.default ISliderwithPageIncrement(double pageIncrement) Returns a copy ofthisimmutable component with the specifiedpageIncrement.default ISliderwithPageIncrement(int pageIncrement) Returns a copy ofthisimmutable component with the specifiedpageIncrement.withPageIncrementInDouble(double pageIncrement) Returns a copy ofthisimmutable component with the specifiedpageIncrement.withScaleInput(double scaleInput) Returns a copy ofthisimmutable component with the specifiedscaleInput.withSlidingtext(String slidingtext) Returns a copy ofthisimmutable component with the specifiedslidingtext.default ISliderwithStep(double step) Returns a copy ofthisimmutable component with the specifiedstep.default ISliderwithStep(int step) Returns a copy ofthisimmutable component with the specifiedstep.withStepInDouble(double step) Returns a copy ofthisimmutable component with the specifiedstep.withStrokeWidth(double strokeWidth) Returns a copy ofthisimmutable 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, withWidgetOverridesMethods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndexMethods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
Field Details
-
DEFAULT
Constant for default attributes of this immutable component. -
SPHERE
Constant for sphere mold attributes of this immutable component. -
SCALE
Constant for scale mold attributes of this immutable component. -
KNOB
Constant for knob mold attributes of this immutable component.
-
-
Method Details
-
getWidgetClass
Returns the client widget class.Default:
"zul.inp.Slider"- Specified by:
getWidgetClassin interfaceIComponent<ISlider>- Returns:
-
getName
Returns the name of this component.Default:
null. -
withName
Returns a copy ofthisimmutable 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
thisobject
-
getOrient
Returns the orient.Default:
"horizontal". -
withOrient
Returns a copy ofthisimmutable component with the specifiedorient.Sets the orient of component
- Parameters:
orient- Either"horizontal"or"vertical"Default:
"horizontal".- Returns:
- A modified copy of the
thisobject
-
withOrient
Returns a copy ofthisimmutable component with the specifiedorient.Sets the orient of component
- Parameters:
orient- TheorientDefault:
"horizontal".- Returns:
- A modified copy of the
thisobject
-
getSlidingtext
Returns the sliding text.Default :
"{0}" -
withSlidingtext
Returns a copy ofthisimmutable component with the specifiedslidingtext.Sets the sliding text.
- Parameters:
slidingtext- The sliding text.Default:
"{0}".- Returns:
- A modified copy of the
thisobject
-
getCurpos
@Lazy default int getCurpos()Returns the current position of the slider.Default:
0. -
withCurpos
Returns a copy ofthisimmutable 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
thisobject
-
withCurpos
Returns a copy ofthisimmutable 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
thisobject
-
getCurposInDouble
default double getCurposInDouble()Returns the double value of slider's current position.Default:
0.0 -
withCurposInDouble
Returns a copy ofthisimmutable 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
thisobject
-
getMinpos
@Lazy default int getMinpos()Returns the minimum position of the slider.Default:
0. -
withMinpos
Returns a copy ofthisimmutable 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
thisobject
-
withMinpos
Returns a copy ofthisimmutable 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
thisobject
-
getMinposInDouble
default double getMinposInDouble()Returns the double value of slider's minimum position.Default:
0.0. -
withMinposInDouble
Returns a copy ofthisimmutable 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
thisobject
-
getMaxpos
@Lazy default int getMaxpos()Returns the value of slider's maximum position.Default:
100. -
withMaxpos
Returns a copy ofthisimmutable 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
thisobject
-
withMaxpos
Returns a copy ofthisimmutable 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
thisobject
-
getMaxposInDouble
default double getMaxposInDouble()Returns the double value of slider's maximum position.Default:
100.0. -
withMaxposInDouble
Returns a copy ofthisimmutable 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
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedstep.Sets the step of slider
- Parameters:
step- The step of sliderDefault:
-1.- Returns:
- A modified copy of the
thisobject
-
withStep
Returns a copy ofthisimmutable component with the specifiedstep.Sets the step of slider
- Parameters:
step- The step of sliderDefault:
-1.0.- Returns:
- A modified copy of the
thisobject
-
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
Returns a copy ofthisimmutable component with the specifiedstep.Sets the step of slider
- Parameters:
step- The step of sliderDefault:
-1.0.- Returns:
- A modified copy of the
thisobject
-
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
Returns a copy ofthisimmutable 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
thisobject
-
withPageIncrement
Returns a copy ofthisimmutable 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
thisobject
-
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
Returns a copy ofthisimmutable 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
thisobject
-
getStrokeWidth
default double getStrokeWidth()Returns the stroke width of the knob slider.Default:
10.0 -
withStrokeWidth
Returns a copy ofthisimmutable 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
thisobject
-
getAngleArc
default double getAngleArc()Returns the degree of arc of the knob slider.Default:
360.0 -
withAngleArc
Returns a copy ofthisimmutable 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
thisobject
-
getScaleInput
default double getScaleInput()Returns the scale ratio of the input in knob mold.Default:
1.0 -
withScaleInput
Returns a copy ofthisimmutable 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
thisobject
-
ofId
Returns the instance with the given id.- Parameters:
id- The id to identify this component.
-



