T - slider value typepublic abstract class SliderBase<T> extends Widget implements HasValue<T>, IsEditor<LeafValueEditor<T>>, HasEnabled, HasId, HasResponsiveness, HasAllSlideHandlers<T>
https://github.com/seiyria/bootstrap-sliderUIObject.DebugIdImpl, UIObject.DebugIdImplEnabledDEBUG_ID_PREFIXSLIDE_CHANGE_EVENT, SLIDE_DISABLED_EVENT, SLIDE_ENABLED_EVENT, SLIDE_EVENT, SLIDE_START_EVENT, SLIDE_STOP_EVENT| Modifier | Constructor and Description |
|---|---|
protected |
SliderBase() |
| Modifier and Type | Method and Description |
|---|---|
HandlerRegistration |
addSlideDisabledHandler(SlideDisabledHandler handler)
Adds a
SlideDisabledEvent handler. |
HandlerRegistration |
addSlideEnabledHandler(SlideEnabledHandler handler)
Adds a
SlideEnabledEvent handler. |
HandlerRegistration |
addSlideHandler(SlideHandler<T> handler)
Adds a
SlideEvent handler. |
HandlerRegistration |
addSlideStartHandler(SlideStartHandler<T> handler)
Adds a
SlideStartEvent handler. |
HandlerRegistration |
addSlideStopHandler(SlideStopHandler<T> handler)
Adds a
SlideStopEvent handler. |
HandlerRegistration |
addValueChangeHandler(ValueChangeHandler<T> handler) |
LeafValueEditor<T> |
asEditor() |
protected abstract T |
convertValue(String value)
Converts the value of the
SliderOption.VALUE attribute to the
slider value. |
protected void |
fireChangeEvent(T value)
Fires a
ValueChangeEvent event. |
protected void |
fireSlideEvent(T value)
Fires a
SlideEvent event. |
protected void |
fireSlideStartEvent(T value)
Fires a
SlideStartEvent event. |
protected void |
fireSlideStopEvent(T value)
Fires a
SlideStopEvent event. |
protected abstract String |
format(T value)
Formats the slider value to string value to be displayed
as tool-tip text.
|
protected String |
formatTooltip(T value) |
boolean |
getFocusHandle() |
HandleType |
getHandle() |
String |
getId() |
double |
getMax() |
double |
getMin() |
OrientationType |
getOrientation() |
double |
getPrecision() |
ScaleType |
getScale() |
SelectionType |
getSelection() |
double |
getStep() |
Element |
getStyleElement() |
List<Double> |
getTicks() |
List<String> |
getTicksLabels() |
List<Double> |
getTicksPositions() |
double |
getTicksSnapBounds() |
TooltipType |
getTooltip() |
TooltipPosition |
getTooltipPosition() |
T |
getValue() |
protected abstract T |
getValue(Element e)
Returns the value by invoking the JSNI getValue command.
|
boolean |
isEnabled() |
boolean |
isNaturalArrowKeys() |
protected boolean |
isRange() |
boolean |
isReversed() |
protected boolean |
isSliderNamespaceAvailable() |
boolean |
isTooltipSplit() |
boolean |
isVisible() |
protected void |
onLoad() |
protected abstract void |
onSlide(Event event)
Called when a
SlideEvent is fired. |
protected abstract void |
onSlideChange(Event event)
Called when a
ValueChangeEvent is fired. |
protected abstract void |
onSlideStart(Event event)
Called when a
SlideStartEvent is fired. |
protected abstract void |
onSlideStop(Event event)
Called when a
SlideStopEvent is fired. |
protected void |
onUnload() |
void |
refresh()
Refreshes the current slider.
|
void |
relayout()
Renders the tool-tip again, after initialization.
|
void |
setEnabled(boolean enabled) |
void |
setFocusHandle(boolean focus)
Focus the appropriate slider handle after a value change.
|
protected abstract void |
setFormatter(Element element)
Sets the callback function of the
SliderOption.FORMATTER attribute. |
void |
setFormatter(FormatterCallback<T> formatterCallback)
Sets the formatter callback.
|
protected abstract void |
setFormatterOption(JavaScriptObject options)
Sets formatter option if defined when attaching to the DOM.
|
void |
setHandle(HandleType handle)
Sets the handle shape.
|
void |
setHiddenOn(DeviceSize deviceSize) |
void |
setId(String id)
Sets the id of the slider element when it's created.
|
void |
setMax(double max)
Sets the maximum possible value.
|
void |
setMin(double min)
Sets the minimum possible value.
|
void |
setNaturalArrowKeys(boolean naturalArrowKeys)
The natural order is used for the arrow keys.
|
void |
setOrientation(OrientationType orientation)
Sets the orientation.
|
void |
setPrecision(double precision)
Sets the number of digits shown after the decimal.
Defaults to the number of digits after the decimal of step value. |
protected void |
setRange(boolean range)
Make range slider if set to
true. |
void |
setReversed(boolean reversed)
Sets whether or not the slider should be reversed.
|
void |
setScale(ScaleType scale)
Sets the slider scale type.
|
void |
setSelection(SelectionType selection)
Sets the selection type.
|
void |
setStep(double step)
Sets the increment step.
|
void |
setTicks(List<Double> ticks)
Sets the values of ticks.
|
void |
setTicksLabels(List<String> ticksLabels)
Sets the labels below the tick marks.
Accepts HTML input. |
void |
setTicksPositions(List<Double> ticksPositions)
Defines the positions of the tick values in percentages.
The first value should always be 0, the last value should always be 100 percent. |
void |
setTicksSnapBounds(double ticksSnapBounds)
Sets the snap bounds of a tick.
|
void |
setTooltip(TooltipType tooltip)
Sets the tool-tip type.
|
void |
setTooltipPosition(TooltipPosition position)
Sets the tool-tip position.
|
void |
setTooltipSplit(boolean tooltipSplit)
Show one too-tip if set to
false, otherwise
show two tool-tips one for each handler. |
protected abstract void |
setValue(Element e,
T value)
Sets the given value to the slider.
|
void |
setValue(T value) |
void |
setValue(T value,
boolean fireEvents) |
void |
setVisible(boolean visible) |
void |
setVisibleOn(DeviceSize deviceSize) |
void |
toggle()
Toggles the slider between enabled and disabled.
|
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setWidth, sinkBitlessEvent, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitfireEventprotected SliderBase()
protected abstract void setFormatterOption(JavaScriptObject options)
options - public void setId(String id)
setId in interface HasIdpublic double getMin()
public void setMin(double min)
min - public double getMax()
public void setMax(double max)
max - public double getStep()
public void setStep(double step)
step - public double getPrecision()
public void setPrecision(double precision)
precision - public OrientationType getOrientation()
public void setOrientation(OrientationType orientation)
orientation - OrientationTypeprotected boolean isRange()
protected void setRange(boolean range)
true. If initial value is scalar,
max will be used for second value.range - public SelectionType getSelection()
public void setSelection(SelectionType selection)
selection - SelectionTypepublic TooltipType getTooltip()
public void setTooltip(TooltipType tooltip)
tooltip - TooltipTypepublic boolean isTooltipSplit()
public void setTooltipSplit(boolean tooltipSplit)
false, otherwise
show two tool-tips one for each handler.tooltipSplit - public TooltipPosition getTooltipPosition()
public void setTooltipPosition(TooltipPosition position)
position - TooltipPositionpublic HandleType getHandle()
public void setHandle(HandleType handle)
handle - HandleTypepublic boolean isReversed()
public void setReversed(boolean reversed)
reversed - public boolean isEnabled()
isEnabled in interface HasEnabledpublic void setEnabled(boolean enabled)
setEnabled in interface HasEnabledpublic void setFormatter(FormatterCallback<T> formatterCallback)
formatterCallback - protected abstract void setFormatter(Element element)
SliderOption.FORMATTER attribute.element - protected String formatTooltip(T value)
protected abstract String format(T value)
value - public boolean isNaturalArrowKeys()
public void setNaturalArrowKeys(boolean naturalArrowKeys)
naturalArrowKeys - public void setTicks(List<Double> ticks)
ticks - public List<Double> getTicksPositions()
public void setTicksPositions(List<Double> ticksPositions)
ticksPositions - public List<String> getTicksLabels()
public void setTicksLabels(List<String> ticksLabels)
ticksLabels - public double getTicksSnapBounds()
public void setTicksSnapBounds(double ticksSnapBounds)
ticksSnapBounds - public void setFocusHandle(boolean focus)
focus - public boolean getFocusHandle()
public void setScale(ScaleType scale)
scale - ScaleTypepublic void setVisible(boolean visible)
setVisible in interface HasVisibilitysetVisible in class UIObjectpublic boolean isVisible()
isVisible in interface HasVisibilityisVisible in class UIObjectpublic void setVisibleOn(DeviceSize deviceSize)
setVisibleOn in interface HasResponsivenesspublic void setHiddenOn(DeviceSize deviceSize)
setHiddenOn in interface HasResponsivenessprotected abstract void setValue(Element e, T value)
e - value - protected abstract T getValue(Element e)
e - protected abstract T convertValue(String value)
SliderOption.VALUE attribute to the
slider value.value - public Element getStyleElement()
getStyleElement in class UIObjectpublic void toggle()
public void refresh()
public void relayout()
public LeafValueEditor<T> asEditor()
asEditor in interface IsEditor<LeafValueEditor<T>>public HandlerRegistration addValueChangeHandler(ValueChangeHandler<T> handler)
addValueChangeHandler in interface HasValueChangeHandlers<T>public HandlerRegistration addSlideHandler(SlideHandler<T> handler)
HasSlideHandlersSlideEvent handler.addSlideHandler in interface HasSlideHandlers<T>handler - the handlerpublic HandlerRegistration addSlideStartHandler(SlideStartHandler<T> handler)
HasSlideStartHandlersSlideStartEvent handler.addSlideStartHandler in interface HasSlideStartHandlers<T>handler - the handlerpublic HandlerRegistration addSlideStopHandler(SlideStopHandler<T> handler)
HasSlideStopHandlersSlideStopEvent handler.addSlideStopHandler in interface HasSlideStopHandlers<T>handler - the handlerpublic HandlerRegistration addSlideEnabledHandler(SlideEnabledHandler handler)
HasSlideEnabledHandlersSlideEnabledEvent handler.addSlideEnabledHandler in interface HasSlideEnabledHandlershandler - the handlerpublic HandlerRegistration addSlideDisabledHandler(SlideDisabledHandler handler)
HasSlideDisabledHandlersSlideDisabledEvent handler.addSlideDisabledHandler in interface HasSlideDisabledHandlershandler - the handlerprotected boolean isSliderNamespaceAvailable()
protected abstract void onSlide(Event event)
SlideEvent is fired.event - the native eventprotected void fireSlideEvent(T value)
SlideEvent event.value - the new slide valueprotected abstract void onSlideStart(Event event)
SlideStartEvent is fired.event - the native eventprotected void fireSlideStartEvent(T value)
SlideStartEvent event.value - the new slide valueprotected abstract void onSlideStop(Event event)
SlideStopEvent is fired.event - the native eventprotected void fireSlideStopEvent(T value)
SlideStopEvent event.value - the new slide valueprotected abstract void onSlideChange(Event event)
ValueChangeEvent is fired.event - the native eventprotected void fireChangeEvent(T value)
ValueChangeEvent event.value - the new slide valueCopyright © 2017. All rights reserved.