Class RangeSlider

All Implemented Interfaces:
HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget, LogicalStructure, HasClearHandlers, HasClickHandlers, HasDoubleClickHandlers, HasDragMoveHandlers, HasDragRepositionMoveHandlers, HasDragRepositionStartHandlers, HasDragRepositionStopHandlers, HasDragResizeMoveHandlers, HasDragResizeStartHandlers, HasDragResizeStopHandlers, HasDragStartHandlers, HasDragStopHandlers, HasDropHandlers, HasDropMoveHandlers, HasDropOutHandlers, HasDropOverHandlers, HasFocusChangedHandlers, HasHoverHandlers, HasHoverHiddenHandlers, HasKeyDownHandlers, HasKeyPressHandlers, HasMouseDownHandlers, HasMouseMoveHandlers, HasMouseOutHandlers, HasMouseOverHandlers, HasMouseStillDownHandlers, HasMouseUpHandlers, HasMouseWheelHandlers, HasMovedHandlers, HasParentMovedHandlers, HasRangeChangedEventHandlers, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasVisibilityChangedHandlers

public class RangeSlider extends Canvas implements HasRangeChangedEventHandlers
A "double slider" allowing the user to select a range via two draggable thumbs.
  • Constructor Details

    • RangeSlider

      public RangeSlider()
    • RangeSlider

      public RangeSlider(JavaScriptObject jsObj)
    • RangeSlider

      public RangeSlider(float minValue, float maxValue, float startValue, float endValue)
      Deprecated.
    • RangeSlider

      public RangeSlider(double minValue, double maxValue, double startValue, double endValue)
  • Method Details

    • getOrCreateRef

      public static RangeSlider getOrCreateRef(JavaScriptObject jsObj)
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, Canvas defaults)
      Changes the defaults for Canvas AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • changeAutoChildDefaults

      public static void changeAutoChildDefaults(String autoChildName, FormItem defaults)
      Changes the defaults for FormItem AutoChildren named autoChildName.
      Parameters:
      autoChildName - name of an AutoChild to customize the defaults for.
      defaults - FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, see SGWTProperties.
      See Also:
    • create

      protected JavaScriptObject create()
      Overrides:
      create in class Canvas
    • setBaseStyle

      public RangeSlider setBaseStyle(String baseStyle) throws IllegalStateException
      Base style name for CSS styles applied to the background of the rangeSlider. The following suffixes are applied for different areas of the slider:
      • "Start": area of the slider before the startThumb
      • "Selected": area of the slider between the thumbs (the selected range)
      • "End": area of the slider after the endThumb
      .. and the following suffixes are applied in addition according to the slider's dynamic state:
      • "Over": if the mouse is over the segment
      • "Down": if the mouse is down on the segment
      For example, if the mouse is down in the area before the start thumb, that area will have the CSS style "rangeSliderStartDown".
      Parameters:
      baseStyle - New baseStyle value. Default value is "rangeSlider"
      Returns:
      RangeSlider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getBaseStyle

      public String getBaseStyle()
      Base style name for CSS styles applied to the background of the rangeSlider. The following suffixes are applied for different areas of the slider:
      • "Start": area of the slider before the startThumb
      • "Selected": area of the slider between the thumbs (the selected range)
      • "End": area of the slider after the endThumb
      .. and the following suffixes are applied in addition according to the slider's dynamic state:
      • "Over": if the mouse is over the segment
      • "Down": if the mouse is down on the segment
      For example, if the mouse is down in the area before the start thumb, that area will have the CSS style "rangeSliderStartDown".
      Returns:
      Current baseStyle value. Default value is "rangeSlider"
      See Also:
    • getEndThumb

      public Snapbar getEndThumb() throws IllegalStateException
      Thumb for the end of the range

      This component is an AutoChild named "endThumb". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current endThumb value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setEndValue

      public RangeSlider setEndValue(float endValue)
      Deprecated.
      The end of the selected range.
      Parameters:
      endValue - New endValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getEndValue

      public float getEndValue()
      Deprecated.
      The end of the selected range.
      Returns:
      Current endValue value. Default value is 0
    • setEndValue

      public RangeSlider setEndValue(double endValue)
      The end of the selected range.
      Parameters:
      endValue - New endValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getEndValueAsDouble

      public double getEndValueAsDouble()
      The end of the selected range.
      Returns:
      Current endValue value. Default value is 0
    • setMaxValue

      public RangeSlider setMaxValue(float maxValue)
      Deprecated.
      Set the maximum value (right/bottom of slider).
      Parameters:
      maxValue - New maxValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getMaxValue

      public float getMaxValue()
      Deprecated.
      Set the maximum value (right/bottom of slider).
      Returns:
      Current maxValue value. Default value is 0
    • setMaxValue

      public RangeSlider setMaxValue(double maxValue)
      Set the maximum value (right/bottom of slider).
      Parameters:
      maxValue - New maxValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getMaxValueAsDouble

      public double getMaxValueAsDouble()
      Set the maximum value (right/bottom of slider).
      Returns:
      Current maxValue value. Default value is 0
    • setMinValue

      public RangeSlider setMinValue(float minValue)
      Deprecated.
      Set the minimum value (left/top of slider).
      Parameters:
      minValue - New minValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getMinValue

      public float getMinValue()
      Deprecated.
      Set the minimum value (left/top of slider).
      Returns:
      Current minValue value. Default value is 0
    • setMinValue

      public RangeSlider setMinValue(double minValue)
      Set the minimum value (left/top of slider).
      Parameters:
      minValue - New minValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getMinValueAsDouble

      public double getMinValueAsDouble()
      Set the minimum value (left/top of slider).
      Returns:
      Current minValue value. Default value is 0
    • getScrollbar

      public Scrollbar getScrollbar() throws IllegalStateException
      Optional Scrollbar shown as a second way of adjusting the range.

      This component is an AutoChild named "scrollbar". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current scrollbar value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • getStartThumb

      public Snapbar getStartThumb() throws IllegalStateException
      Thumb for the start of the range.

      This component is an AutoChild named "startThumb". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current startThumb value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setStartValue

      public RangeSlider setStartValue(float startValue)
      Deprecated.
      The beginning of the selected range.
      Parameters:
      startValue - New startValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getStartValue

      public float getStartValue()
      Deprecated.
      The beginning of the selected range.
      Returns:
      Current startValue value. Default value is 0
    • setStartValue

      public RangeSlider setStartValue(double startValue)
      The beginning of the selected range.
      Parameters:
      startValue - New startValue value. Default value is 0
      Returns:
      RangeSlider instance, for chaining setter calls
    • getStartValueAsDouble

      public double getStartValueAsDouble()
      The beginning of the selected range.
      Returns:
      Current startValue value. Default value is 0
    • getTrack

      public Canvas getTrack() throws IllegalStateException
      Optional track of the RangeSlider. Set showTrack false to avoid showing a track so the RangeSlider can be superimposed over something else.

      This component is an AutoChild named "track". For an overview of how to use and configure AutoChildren, see Using AutoChildren.

      Returns:
      Current track value. Default value is null
      Throws:
      IllegalStateException - if this widget has not yet been rendered.
    • setVertical

      public RangeSlider setVertical(boolean vertical) throws IllegalStateException
      Whether the rangeSlider should be vertical or horizontal. Default is horizontal.
      Parameters:
      vertical - New vertical value. Default value is false
      Returns:
      RangeSlider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getVertical

      public boolean getVertical()
      Whether the rangeSlider should be vertical or horizontal. Default is horizontal.
      Returns:
      Current vertical value. Default value is false
    • addRangeChangedEventHandler

      public HandlerRegistration addRangeChangedEventHandler(RangeChangedEventHandler handler)
      Add a RangeChangedEvent handler.

      Notification fired when the selected range is changed by the end user.

      Specified by:
      addRangeChangedEventHandler in interface HasRangeChangedEventHandlers
      Parameters:
      handler - the RangeChangedEvent handler
      Returns:
      HandlerRegistration used to remove this handler
    • setDefaultProperties

      public static void setDefaultProperties(RangeSlider rangeSliderProperties)
      Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties set on the SmartGWT class instance passed to this function before its underlying SmartClient JS object was created. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.

      Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.

      Parameters:
      rangeSliderProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(RangeSliderLogicalStructure s)
      Setter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
    • getLogicalStructure

      public LogicalStructureObject getLogicalStructure()
      Getter implementing the LogicalStructure interface, which supports Eclipse's logical structure debugging facility.
      Specified by:
      getLogicalStructure in interface LogicalStructure
      Overrides:
      getLogicalStructure in class Canvas