Interface ISlider
-
- All Superinterfaces:
IAnyGroup<ISlider>,IComponent<ISlider>,IHtmlBasedComponent<ISlider>,IXulElement<ISlider>
public interface ISlider extends IXulElement<ISlider>, IAnyGroup<ISlider>
ImmutableSlidercomponentA 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
maxposattribute. 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 thegetPosmethod 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 classISlider.BuilderBuilds instances of typeISlider.static classISlider.OrientSpecifies the orient ofISlidercomponentstatic classISlider.UpdaterBuilds an updater of typeISliderforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Field Summary
Fields Modifier and Type Field Description static ISliderDEFAULTConstant for default attributes of this immutable component.static ISliderKNOBConstant for knob mold attributes of this immutable component.static ISliderSCALEConstant for scale mold attributes of this immutable component.static ISliderSPHEREConstant 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 doublegetAngleArc()Returns the degree of arc of the knob slider.default intgetCurpos()Returns the current position of the slider.default doublegetCurposInDouble()Returns the double value of slider's current position.default intgetMaxpos()Returns the value of slider's maximum position.default doublegetMaxposInDouble()Returns the double value of slider's maximum position.default intgetMinpos()Returns the minimum position of the slider.default doublegetMinposInDouble()Returns the double value of slider's minimum position.java.lang.StringgetName()Returns the name of this component.default java.lang.StringgetOrient()Returns the orient.default intgetPageIncrement()Returns the amount that the value ofgetCurpos()changes by when the tray of the scroll bar is clicked.default doublegetPageIncrementInDouble()Returns the amount that the value ofgetCurpos()changes by when the tray of the scroll bar is clicked.default doublegetScaleInput()Returns the scale ratio of the input in knob mold.default java.lang.StringgetSlidingtext()Returns the sliding text.default intgetStep()Returns the step of sliderdefault doublegetStepInDouble()Returns the step of sliderdefault doublegetStrokeWidth()Returns the stroke width of the knob slider.default java.lang.StringgetWidgetClass()Returns the client widget class.static ISliderofId(java.lang.String id)Returns the instance with the given id.ISliderwithAngleArc(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.ISliderwithCurposInDouble(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.ISliderwithMaxposInDouble(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.ISliderwithMinposInDouble(double minpos)Returns a copy ofthisimmutable component with the specifiedminpos.ISliderwithName(java.lang.String name)Returns a copy ofthisimmutable component with the specifiedname.ISliderwithOrient(java.lang.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.ISliderwithPageIncrementInDouble(double pageIncrement)Returns a copy ofthisimmutable component with the specifiedpageIncrement.ISliderwithScaleInput(double scaleInput)Returns a copy ofthisimmutable component with the specifiedscaleInput.ISliderwithSlidingtext(java.lang.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.ISliderwithStepInDouble(double step)Returns a copy ofthisimmutable component with the specifiedstep.ISliderwithStrokeWidth(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, 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:
getWidgetClassin 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 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
default java.lang.String getOrient()
Returns the orient.Default:
"horizontal".
-
withOrient
ISlider withOrient(java.lang.String orient)
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
default ISlider withOrient(ISlider.Orient orient)
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
default java.lang.String getSlidingtext()
Returns the sliding text.Default :
"{0}"
-
withSlidingtext
ISlider withSlidingtext(java.lang.String slidingtext)
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
default ISlider withCurpos(int curpos)
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
default ISlider withCurpos(double curpos)
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
ISlider withCurposInDouble(double curpos)
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
default ISlider withMinpos(int minpos)
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
default ISlider withMinpos(double minpos)
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
ISlider withMinposInDouble(double minpos)
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
default ISlider withMaxpos(int maxpos)
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
default ISlider withMaxpos(double maxpos)
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
ISlider withMaxposInDouble(double maxpos)
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
default ISlider withStep(int step)
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
default ISlider withStep(double step)
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
ISlider withStepInDouble(double step)
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
default ISlider withPageIncrement(int pageIncrement)
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
default ISlider withPageIncrement(double pageIncrement)
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
ISlider withPageIncrementInDouble(double pageIncrement)
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
ISlider withStrokeWidth(double strokeWidth)
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
ISlider withAngleArc(double angleArc)
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
ISlider withScaleInput(double scaleInput)
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
static ISlider ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component.
-
-