Class IntegerRangeSlider
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.BlurNotifier<IntegerRangeSlider>,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.Focusable<IntegerRangeSlider>,com.vaadin.flow.component.FocusNotifier<IntegerRangeSlider>,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasHelper,com.vaadin.flow.component.HasLabel,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasValidation,com.vaadin.flow.component.HasValue<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerRangeSlider,,IntegerRangeSliderValue>, IntegerRangeSliderValue> com.vaadin.flow.component.HasValueAndElement<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerRangeSlider,,IntegerRangeSliderValue>, IntegerRangeSliderValue> com.vaadin.flow.component.KeyNotifier,com.vaadin.flow.component.shared.HasTooltip,com.vaadin.flow.component.shared.HasValidationProperties,com.vaadin.flow.component.shared.InputField<com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<IntegerRangeSlider,,IntegerRangeSliderValue>, IntegerRangeSliderValue> com.vaadin.flow.data.value.HasValueChangeMode,Serializable
IntegerRangeSlider uses Integer as the value type for its start and
end values, see RangeSlider for a version of the component that
supports decimal values.
- Author:
- Vaadin Ltd.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.vaadin.flow.component.AbstractField
com.vaadin.flow.component.AbstractField.ComponentValueChangeEvent<C extends com.vaadin.flow.component.Component,V> Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.HasValue
com.vaadin.flow.component.HasValue.ValueChangeEvent<V>, com.vaadin.flow.component.HasValue.ValueChangeListener<E extends com.vaadin.flow.component.HasValue.ValueChangeEvent<?>> -
Field Summary
Fields inherited from interface com.vaadin.flow.data.value.HasValueChangeMode
DEFAULT_CHANGE_TIMEOUT -
Constructor Summary
ConstructorsConstructorDescriptionConstructs anIntegerRangeSliderwith min 0 and max 100.IntegerRangeSlider(int min, int max) Constructs anIntegerRangeSliderwith the given min and max.IntegerRangeSlider(String label) Constructs anIntegerRangeSliderwith the given label, min 0, and max 100.IntegerRangeSlider(String label, int min, int max) Constructs anIntegerRangeSliderwith the given label, min and max. -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.dom.SignalBinding<Integer> Binds the given signal to the maximum value of the slider as a one-way binding so that the property is updated when the signal's value is updated.com.vaadin.flow.dom.SignalBinding<Integer> Binds the given signal to the minimum value of the slider as a one-way binding so that the property is updated when the signal's value is updated.com.vaadin.flow.dom.SignalBinding<Integer> Binds the given signal to the step value of the slider as a one-way binding so that the property is updated when the signal's value is updated.voidclear()Clears the slider value, setting it to the full range from minimum to maximum.Gets the accessible name for the end range input element of the slider.Gets the accessible name for the start range input element of the slider.getMax()Gets the maximum value of the slider.getMin()Gets the minimum value of the slider.getStep()Gets the step value of the slider.com.vaadin.flow.data.value.ValueChangeModeintprotected booleanbooleanGets whether the min and max values are displayed below the slider track.protected booleanbooleanGets whether the value bubble is always visible, regardless of focus or hover state.protected booleanprotected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidsetAccessibleNameEnd(String accessibleName) Sets an accessible name for the end range input element of the slider.voidsetAccessibleNameStart(String accessibleName) Sets an accessible name for the start range input element of the slider.voidSets the maximum value of the slider.voidSets the minimum value of the slider.voidsetMinMaxVisible(boolean minMaxVisible) Sets whether the min and max values are displayed below the slider track.voidSets the step value of the slider.voidsetValue(IntegerRangeSliderValue value) voidsetValueAlwaysVisible(boolean valueAlwaysVisible) Sets whether the value bubble is always visible, regardless of focus or hover state.voidsetValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode) voidsetValueChangeTimeout(int valueChangeTimeout) Methods inherited from class com.vaadin.flow.component.AbstractSinglePropertyField
getSynchronizationRegistration, setPresentationValue, setSynchronizedEventMethods inherited from class com.vaadin.flow.component.AbstractField
addValueChangeListener, bindValue, getEmptyValue, getValue, isEmpty, setModelValue, valueEqualsMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasHelper
bindHelperText, getHelperComponent, getHelperText, setHelperComponent, setHelperTextMethods inherited from interface com.vaadin.flow.component.HasLabel
getLabel, setLabelMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.shared.HasTooltip
getTooltip, setTooltipMarkdown, setTooltipTextMethods inherited from interface com.vaadin.flow.component.HasValidation
setManualValidationMethods inherited from interface com.vaadin.flow.component.shared.HasValidationProperties
getErrorMessage, isInvalid, setErrorMessage, setInvalidMethods inherited from interface com.vaadin.flow.component.HasValue
addValueChangeListener, bindValue, getEmptyValue, getOptionalValue, getValue, isEmptyMethods inherited from interface com.vaadin.flow.component.HasValueAndElement
bindReadOnly, bindRequiredIndicatorVisible, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisibleMethods inherited from interface com.vaadin.flow.component.KeyNotifier
addKeyDownListener, addKeyDownListener, addKeyPressListener, addKeyPressListener, addKeyUpListener, addKeyUpListener
-
Constructor Details
-
IntegerRangeSlider
public IntegerRangeSlider()Constructs anIntegerRangeSliderwith min 0 and max 100. The initial value is [0, 100].The step defaults to 1.
-
IntegerRangeSlider
public IntegerRangeSlider(int min, int max) Constructs anIntegerRangeSliderwith the given min and max. The initial value is set to [min, max].The step defaults to 1.
- Parameters:
min- the minimum valuemax- the maximum value
-
IntegerRangeSlider
Constructs anIntegerRangeSliderwith the given label, min 0, and max 100. The initial value is [0, 100].The step defaults to 1.
- Parameters:
label- the text to set as the label
-
IntegerRangeSlider
Constructs anIntegerRangeSliderwith the given label, min and max. The initial value is set to [min, max].The step defaults to 1.
- Parameters:
label- the text to set as the labelmin- the minimum valuemax- the maximum value
-
-
Method Details
-
setAccessibleNameStart
Sets an accessible name for the start range input element of the slider.- Parameters:
accessibleName- the accessible name to set, ornullto remove it
-
getAccessibleNameStart
Gets the accessible name for the start range input element of the slider.- Returns:
- an optional accessible name, or an empty optional if no accessible name has been set
-
setAccessibleNameEnd
Sets an accessible name for the end range input element of the slider.- Parameters:
accessibleName- the accessible name to set, ornullto remove it
-
getAccessibleNameEnd
Gets the accessible name for the end range input element of the slider.- Returns:
- an optional accessible name, or an empty optional if no accessible name has been set
-
clear
public void clear()Clears the slider value, setting it to the full range from minimum to maximum.- See Also:
-
isValueWithinMinMax
-
isValueAlignedWithStep
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
getMin
Gets the minimum value of the slider.- Returns:
- the minimum value
-
setMin
Sets the minimum value of the slider.- Parameters:
min- the minimum value
-
getMax
Gets the maximum value of the slider.- Returns:
- the maximum value
-
setMax
Sets the maximum value of the slider.- Parameters:
max- the maximum value
-
getStep
Gets the step value of the slider.Valid slider values are calculated relative to the minimum value:
min,min + step,min + 2*step, etc.- Returns:
- the step value
-
setStep
Sets the step value of the slider.Valid slider values are calculated relative to the minimum value:
min,min + step,min + 2*step, etc.- Parameters:
step- the step value
-
bindMin
public com.vaadin.flow.dom.SignalBinding<Integer> bindMin(com.vaadin.flow.signals.Signal<Integer> signal) Binds the given signal to the minimum value of the slider as a one-way binding so that the property is updated when the signal's value is updated.The minimum value is set immediately with the current signal value when the binding is created, and is kept synchronized with any subsequent signal value changes while the component is in attached state. When the component is in detached state, signal value changes have no effect.
While a signal is bound, any attempt to set the minimum value manually through the setter throws a
BindingActiveException.- Parameters:
signal- the signal to bind the minimum value to, notnull- Returns:
- a
SignalBindingthat can be used to registeronChangecallbacks - Since:
- 25.1
- See Also:
-
bindMax
public com.vaadin.flow.dom.SignalBinding<Integer> bindMax(com.vaadin.flow.signals.Signal<Integer> signal) Binds the given signal to the maximum value of the slider as a one-way binding so that the property is updated when the signal's value is updated.The maximum value is set immediately with the current signal value when the binding is created, and is kept synchronized with any subsequent signal value changes while the component is in attached state. When the component is in detached state, signal value changes have no effect.
While a signal is bound, any attempt to set the maximum value manually through the setter throws a
BindingActiveException.- Parameters:
signal- the signal to bind the maximum value to, notnull- Returns:
- a
SignalBindingthat can be used to registeronChangecallbacks - Since:
- 25.1
- See Also:
-
bindStep
public com.vaadin.flow.dom.SignalBinding<Integer> bindStep(com.vaadin.flow.signals.Signal<Integer> signal) Binds the given signal to the step value of the slider as a one-way binding so that the property is updated when the signal's value is updated.The step value is set immediately with the current signal value when the binding is created, and is kept synchronized with any subsequent signal value changes while the component is in attached state. When the component is in detached state, signal value changes have no effect.
While a signal is bound, any attempt to set the step value manually through the setter throws a
BindingActiveException.- Parameters:
signal- the signal to bind the step value to, notnull- Returns:
- a
SignalBindingthat can be used to registeronChangecallbacks - Since:
- 25.1
- See Also:
-
setValueAlwaysVisible
public void setValueAlwaysVisible(boolean valueAlwaysVisible) Sets whether the value bubble is always visible, regardless of focus or hover state. By default, bubble is hidden and only shown on interaction.- Parameters:
valueAlwaysVisible-trueto always show the value bubble,falseotherwise
-
isValueAlwaysVisible
public boolean isValueAlwaysVisible()Gets whether the value bubble is always visible, regardless of focus or hover state. By default, bubble is hidden and only shown on interaction.- Returns:
trueif the value bubble is always visible,falseotherwise
-
setMinMaxVisible
public void setMinMaxVisible(boolean minMaxVisible) Sets whether the min and max values are displayed below the slider track. By default, min and max values are hidden.- Parameters:
minMaxVisible-trueto display min and max values,falseotherwise
-
isMinMaxVisible
public boolean isMinMaxVisible()Gets whether the min and max values are displayed below the slider track. By default, min and max values are hidden.- Returns:
trueif the min and max values are displayed,falseotherwise
-
getValueChangeMode
public com.vaadin.flow.data.value.ValueChangeMode getValueChangeMode()The default value is
ValueChangeMode.ON_CHANGE.- Specified by:
getValueChangeModein interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValueChangeMode
public void setValueChangeMode(com.vaadin.flow.data.value.ValueChangeMode valueChangeMode) - Specified by:
setValueChangeModein interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValueChangeTimeout
public void setValueChangeTimeout(int valueChangeTimeout) - Specified by:
setValueChangeTimeoutin interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
getValueChangeTimeout
public int getValueChangeTimeout()- Specified by:
getValueChangeTimeoutin interfacecom.vaadin.flow.data.value.HasValueChangeMode
-
setValue
- Specified by:
setValuein interfacecom.vaadin.flow.component.HasValue<TComponent extends com.vaadin.flow.component.slider.SliderBase<TComponent,TValue, TNumber, TPresentation>, TValue> - Overrides:
setValuein classcom.vaadin.flow.component.AbstractField<TComponent extends com.vaadin.flow.component.slider.SliderBase<TComponent,TValue, TNumber, TPresentation>, TValue>
-
hasValidValue
protected boolean hasValidValue()- Overrides:
hasValidValuein classcom.vaadin.flow.component.AbstractSinglePropertyField<TComponent extends com.vaadin.flow.component.slider.SliderBase<TComponent,TValue, TNumber, TPresentation>, TValue>
-