Class Slider

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, HasResizedHandlers, HasRightMouseDownHandlers, HasRuleContextChangedHandlers, HasScrolledHandlers, HasShowContextMenuHandlers, HasValueChangedHandlers, HasVisibilityChangedHandlers

public class Slider extends Canvas implements HasValueChangedHandlers
The Slider class implements a GUI slider widget allowing the user to select a numeric value from within a range by dragging a visual indicator up and down a track.

The slider will generate events as the user interacts with it and changes its value. If slider.sliderTarget is specified, moving the slider thumb generates a custom event named 'sliderMove', sent to the sliderTarget. If a sliderMove handler stringMethod is defined on the target, it will be fired when the slider is moved. The second parameter (available via the variable name eventInfo if the handler is a string) is a pointer back to the slider.

The slider will also fire a valueChanged() method whenever its value is changed. This can be observed or overridden on the Slider instance to perform some action.

  • Constructor Details

  • Method Details

    • getOrCreateRef

      public static Slider 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
    • getActiveTrack

      public StatefulCanvas getActiveTrack() throws IllegalStateException
      A styled canvas used to highlight the active part of the slider track.

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

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

      public Slider setActiveTrackStyle(String activeTrackStyle) throws IllegalStateException
      CSS style used to highlight the active part of the slider track.

      Will have the suffix "Disabled" added when the slider is disabled.

      Parameters:
      activeTrackStyle - New activeTrackStyle value. Default value is "sliderTrackActive"
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getActiveTrackStyle

      public String getActiveTrackStyle()
      CSS style used to highlight the active part of the slider track.

      Will have the suffix "Disabled" added when the slider is disabled.

      Returns:
      Current activeTrackStyle value. Default value is "sliderTrackActive"
      See Also:
    • setAnimateThumb

      public Slider setAnimateThumb(Boolean animateThumb)
      Should the thumb be animated to its new position when the value is changed programmatically, or by clicking in the slider track.
      Parameters:
      animateThumb - New animateThumb value. Default value is true
      Returns:
      Slider instance, for chaining setter calls
    • getAnimateThumb

      public Boolean getAnimateThumb()
      Should the thumb be animated to its new position when the value is changed programmatically, or by clicking in the slider track.
      Returns:
      Current animateThumb value. Default value is true
    • setAnimateThumbInit

      public Slider setAnimateThumbInit(Boolean animateThumbInit)
      If thumb animation is enabled, should the thumb be animated to its initial value?
      Parameters:
      animateThumbInit - New animateThumbInit value. Default value is false
      Returns:
      Slider instance, for chaining setter calls
    • getAnimateThumbInit

      public Boolean getAnimateThumbInit()
      If thumb animation is enabled, should the thumb be animated to its initial value?
      Returns:
      Current animateThumbInit value. Default value is false
    • setAnimateThumbTime

      public Slider setAnimateThumbTime(int animateThumbTime)
      Duration of thumb animation, in milliseconds.
      Parameters:
      animateThumbTime - New animateThumbTime value. Default value is 250
      Returns:
      Slider instance, for chaining setter calls
    • getAnimateThumbTime

      public int getAnimateThumbTime()
      Duration of thumb animation, in milliseconds.
      Returns:
      Current animateThumbTime value. Default value is 250
    • setCanFocus

      public Slider setCanFocus(Boolean canFocus)
      Indicates whether keyboard manipulation of the slider is allowed.
      Overrides:
      setCanFocus in class Canvas
      Parameters:
      canFocus - New canFocus value. Default value is true
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getCanFocus

      public Boolean getCanFocus()
      Indicates whether keyboard manipulation of the slider is allowed.
      Overrides:
      getCanFocus in class Canvas
      Returns:
      Current canFocus value. Default value is true
      See Also:
    • setFlipValues

      public Slider setFlipValues(Boolean flipValues)
      Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down (for a vertical slider) or to the left (for a horizontal slider).

      If this method is called after the component has been drawn/initialized: Sets the flipValues property of the slider
      Parameters:
      flipValues - flip slider values?. Default value is false
      Returns:
      Slider instance, for chaining setter calls
    • getFlipValues

      public Boolean getFlipValues()
      Specifies whether the value range of the slider should be flipped so that values increase as the thumb is moved down (for a vertical slider) or to the left (for a horizontal slider).
      Returns:
      Current flipValues value. Default value is false
    • setHLabelSpacing

      public Slider setHLabelSpacing(Integer hLabelSpacing)
      The space around the labels used to display the minimum, maximum and current values of the slider, when vertical is false. If unset, defaults to labelSpacing.
      Parameters:
      hLabelSpacing - New hLabelSpacing value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
    • getHLabelSpacing

      public Integer getHLabelSpacing()
      The space around the labels used to display the minimum, maximum and current values of the slider, when vertical is false. If unset, defaults to labelSpacing.
      Returns:
      Current hLabelSpacing value. Default value is null
    • setHThumbStyle

      public Slider setHThumbStyle(String hThumbStyle) throws IllegalStateException
      Optional CSS style for the thumb for a horizontally oriented slider.

      Will have the suffix "down" added when the mouse is down on the thumb, and "Disabled" added when the slider is disabled.

      Parameters:
      hThumbStyle - New hThumbStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getHThumbStyle

      public String getHThumbStyle()
      Optional CSS style for the thumb for a horizontally oriented slider.

      Will have the suffix "down" added when the mouse is down on the thumb, and "Disabled" added when the slider is disabled.

      Returns:
      Current hThumbStyle value. Default value is null
      See Also:
    • setHTrackStyle

      public Slider setHTrackStyle(String hTrackStyle) throws IllegalStateException
      Optional CSS style for the track for a horizontally oriented slider.

      Will have the suffix "Disabled" added when the slider is disabled.

      Parameters:
      hTrackStyle - New hTrackStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getHTrackStyle

      public String getHTrackStyle()
      Optional CSS style for the track for a horizontally oriented slider.

      Will have the suffix "Disabled" added when the slider is disabled.

      Returns:
      Current hTrackStyle value. Default value is null
      See Also:
    • setHValueStyle

      public Slider setHValueStyle(String hValueStyle) throws IllegalStateException
      Optional CSS style for the floating valueLabel, visible when showValue is true and vertical is false.
      Parameters:
      hValueStyle - New hValueStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getHValueStyle

      public String getHValueStyle()
      Optional CSS style for the floating valueLabel, visible when showValue is true and vertical is false.
      Returns:
      Current hValueStyle value. Default value is null
      See Also:
    • setLabelHeight

      public Slider setLabelHeight(int labelHeight)
      The height of the labels used to display the minimum, maximum and current values of the slider.

      If this method is called after the component has been drawn/initialized: Sets the labelHeight property of the slider
      Parameters:
      labelHeight - new label height. Default value is 20
      Returns:
      Slider instance, for chaining setter calls
    • getLabelHeight

      public int getLabelHeight()
      The height of the labels used to display the minimum, maximum and current values of the slider.
      Returns:
      Current labelHeight value. Default value is 20
    • setLabelSpacing

      public Slider setLabelSpacing(int labelSpacing)
      The space around the labels used to display the minimum, maximum and current values of the slider.

      If this method is called after the component has been drawn/initialized: Sets the labelSpacing property of the slider
      Parameters:
      labelSpacing - new label spacing. Default value is 5
      Returns:
      Slider instance, for chaining setter calls
    • getLabelSpacing

      public int getLabelSpacing()
      The space around the labels used to display the minimum, maximum and current values of the slider.
      Returns:
      Current labelSpacing value. Default value is 5
    • setLabelWidth

      public Slider setLabelWidth(int labelWidth)
      The width of the labels used to display the minimum, maximum and current values of the slider.

      If this method is called after the component has been drawn/initialized: Sets the labelWidth property of the slider
      Parameters:
      labelWidth - new label width. Default value is 50
      Returns:
      Slider instance, for chaining setter calls
    • getLabelWidth

      public int getLabelWidth()
      The width of the labels used to display the minimum, maximum and current values of the slider.
      Returns:
      Current labelWidth value. Default value is 50
    • setLength

      public Slider setLength(int length)
      Used to set slider height if vertical, slider width if horizontal. Applied to the slider track, not necessarily the entire widget. Overridden by an explicit width/height specification for the widget.
      Parameters:
      length - New length value. Default value is 200
      Returns:
      Slider instance, for chaining setter calls
    • getLength

      public int getLength()
      Used to set slider height if vertical, slider width if horizontal. Applied to the slider track, not necessarily the entire widget. Overridden by an explicit width/height specification for the widget.
      Returns:
      Current length value. Default value is 200
    • setMaxValue

      public Slider setMaxValue(float maxValue)
      Deprecated.
      The maximum slider value. The slider value is equal to maxValue when the thumb is at the top or right of the slider (unless flipValues is true, in which case the maximum value is at the bottom/left of the slider)

      If this method is called after the component has been drawn/initialized: Sets the maximum value of the slider
      Parameters:
      maxValue - the new maximum value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 100
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMaxValue

      public float getMaxValue()
      Deprecated.
      The maximum slider value. The slider value is equal to maxValue when the thumb is at the top or right of the slider (unless flipValues is true, in which case the maximum value is at the bottom/left of the slider)
      Returns:
      Current maxValue value. Default value is 100
      See Also:
    • setMaxValue

      public Slider setMaxValue(double maxValue)
      The maximum slider value. The slider value is equal to maxValue when the thumb is at the top or right of the slider (unless flipValues is true, in which case the maximum value is at the bottom/left of the slider)

      If this method is called after the component has been drawn/initialized: Sets the maximum value of the slider
      Parameters:
      maxValue - the new maximum value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 100
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMaxValueAsDouble

      public double getMaxValueAsDouble()
      The maximum slider value. The slider value is equal to maxValue when the thumb is at the top or right of the slider (unless flipValues is true, in which case the maximum value is at the bottom/left of the slider)
      Returns:
      Current maxValue value. Default value is 100
      See Also:
    • setMaxValueLabel

      public Slider setMaxValueLabel(String maxValueLabel)
      The text displayed in the label for the maximum value of the slider. If left as null, then slider.maxValue will be displayed.

      If this method is called after the component has been drawn/initialized: Sets the maxValueLabel property of the slider
      Parameters:
      maxValueLabel - new label text. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMaxValueLabel

      public String getMaxValueLabel()
      The text displayed in the label for the maximum value of the slider. If left as null, then slider.maxValue will be displayed.
      Returns:
      Current maxValueLabel value. Default value is null
      See Also:
    • setMinValue

      public Slider setMinValue(float minValue)
      Deprecated.
      The minimum slider value. The slider value is equal to minValue when the thumb is at the bottom or left of the slider (unless flipValues is true, in which case the minimum value is at the top/right of the slider)

      If this method is called after the component has been drawn/initialized: Sets the minimum value of the slider
      Parameters:
      minValue - the new minimum value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 1
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMinValue

      public float getMinValue()
      Deprecated.
      The minimum slider value. The slider value is equal to minValue when the thumb is at the bottom or left of the slider (unless flipValues is true, in which case the minimum value is at the top/right of the slider)
      Returns:
      Current minValue value. Default value is 1
      See Also:
    • setMinValue

      public Slider setMinValue(double minValue)
      The minimum slider value. The slider value is equal to minValue when the thumb is at the bottom or left of the slider (unless flipValues is true, in which case the minimum value is at the top/right of the slider)

      If this method is called after the component has been drawn/initialized: Sets the minimum value of the slider
      Parameters:
      minValue - the new minimum value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 1
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMinValueAsDouble

      public double getMinValueAsDouble()
      The minimum slider value. The slider value is equal to minValue when the thumb is at the bottom or left of the slider (unless flipValues is true, in which case the minimum value is at the top/right of the slider)
      Returns:
      Current minValue value. Default value is 1
      See Also:
    • setMinValueLabel

      public Slider setMinValueLabel(String minValueLabel)
      The text displayed in the label for the minimum value of the slider. If left as null, then slider.minValue will be displayed.
      Parameters:
      minValueLabel - New minValueLabel value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getMinValueLabel

      public String getMinValueLabel()
      The text displayed in the label for the minimum value of the slider. If left as null, then slider.minValue will be displayed.
      Returns:
      Current minValueLabel value. Default value is null
      See Also:
    • setNumValues

      public Slider setNumValues(Integer numValues)
      The number of discrete values represented by slider. If specified, the range of valid values (between minValue and maxValue) will be divided into this many steps. As the thumb is moved along the track it will only select these values and appear to jump between the steps.

      If this method is called after the component has been drawn/initialized: Sets the number of values for the slider
      Parameters:
      numValues - the new number of values Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getNumValues

      public Integer getNumValues()
      The number of discrete values represented by slider. If specified, the range of valid values (between minValue and maxValue) will be divided into this many steps. As the thumb is moved along the track it will only select these values and appear to jump between the steps.
      Returns:
      Current numValues value. Default value is null
      See Also:
    • setRangeFormat

      public Slider setRangeFormat(String rangeFormat) throws IllegalStateException
      FormatString for numeric formatting of the range labels. If unset, defaults to valueFormat
      Parameters:
      rangeFormat - New rangeFormat value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getRangeFormat

      public String getRangeFormat()
      FormatString for numeric formatting of the range labels. If unset, defaults to valueFormat
      Returns:
      Current rangeFormat value. Default value is null
      See Also:
    • getRangeLabel

      public Label getRangeLabel()
      Note : This API is non-functional (always returns null) and exists only to make you aware that this MultiAutoChild exists. See Using AutoChildren for details.

      Used to create both of the min and max range-labels, via the com.smartgwt.client.types.AutoChild pattern, hence rangeLabelConstructor, rangeLabelDefaults and rangeLabelProperties are valid.

      Returns:
      null
    • setRangeStyle

      public Slider setRangeStyle(String rangeStyle) throws IllegalStateException
      CSS style for the min and max range-labels, when showRange is true.
      Parameters:
      rangeStyle - New rangeStyle value. Default value is "sliderRange"
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getRangeStyle

      public String getRangeStyle()
      CSS style for the min and max range-labels, when showRange is true.
      Returns:
      Current rangeStyle value. Default value is "sliderRange"
      See Also:
    • setRoundPrecision

      public Slider setRoundPrecision(int roundPrecision)
      If roundValues is false, the slider value will be rounded to this number of decimal places. If set to null the value will not be rounded

      If this method is called after the component has been drawn/initialized: Sets the roundPrecision property of the slider
      Parameters:
      roundPrecision - new round precision. Default value is 1
      Returns:
      Slider instance, for chaining setter calls
    • getRoundPrecision

      public int getRoundPrecision()
      If roundValues is false, the slider value will be rounded to this number of decimal places. If set to null the value will not be rounded
      Returns:
      Current roundPrecision value. Default value is 1
    • setRoundValues

      public Slider setRoundValues(Boolean roundValues)
      Specifies whether the slider value should be rounded to the nearest integer. If set to false, values will be rounded to a fixed number of decimal places controlled by roundPrecision.

      If this method is called after the component has been drawn/initialized: Sets the roundValues property of the slider
      Parameters:
      roundValues - round slider values?. Default value is true
      Returns:
      Slider instance, for chaining setter calls
    • getRoundValues

      public Boolean getRoundValues()
      Specifies whether the slider value should be rounded to the nearest integer. If set to false, values will be rounded to a fixed number of decimal places controlled by roundPrecision.
      Returns:
      Current roundValues value. Default value is true
    • setShowActiveTrack

      public Slider setShowActiveTrack(Boolean showActiveTrack) throws IllegalStateException
      Whether to show the activeTrack, which highlights the 'active' portion of a slider, from its minimum to its current value.
      Parameters:
      showActiveTrack - New showActiveTrack value. Default value is false
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
    • getShowActiveTrack

      public Boolean getShowActiveTrack()
      Whether to show the activeTrack, which highlights the 'active' portion of a slider, from its minimum to its current value.
      Returns:
      Current showActiveTrack value. Default value is false
    • setShowRange

      public Slider setShowRange(Boolean showRange)
      Indicates whether labels for the min and max values of the slider should be displayed. The default positions for these labels are below the start/end of a horizontal slider, or to the right of the start/end of a vertical slider.

      If this method is called after the component has been drawn/initialized: Sets the showRange property of the slider
      Parameters:
      showRange - show the slider range?. Default value is true
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getShowRange

      public Boolean getShowRange()
      Indicates whether labels for the min and max values of the slider should be displayed. The default positions for these labels are below the start/end of a horizontal slider, or to the right of the start/end of a vertical slider.
      Returns:
      Current showRange value. Default value is true
      See Also:
    • setShowTitle

      public Slider setShowTitle(Boolean showTitle)
      Indicates whether the slider's title should be displayed. The default position for the title-label is to the left of a horizontal slider, or above a vertical slider.

      If this method is called after the component has been drawn/initialized: Sets the showTitle property of the slider
      Parameters:
      showTitle - show the slider title?. Default value is true
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getShowTitle

      public Boolean getShowTitle()
      Indicates whether the slider's title should be displayed. The default position for the title-label is to the left of a horizontal slider, or above a vertical slider.
      Returns:
      Current showTitle value. Default value is true
      See Also:
    • setShowValue

      public Slider setShowValue(Boolean showValue)
      Indicates whether a label for the value of the slider should be displayed. The default position for this label is to the right of a vertical slider, or below a horizontal slider.

      If this method is called after the component has been drawn/initialized: Sets the showValue property of the slider
      Parameters:
      showValue - show the slider value?. Default value is true
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getShowValue

      public Boolean getShowValue()
      Indicates whether a label for the value of the slider should be displayed. The default position for this label is to the right of a vertical slider, or below a horizontal slider.
      Returns:
      Current showValue value. Default value is true
      See Also:
    • setStepPercent

      public Slider setStepPercent(float stepPercent)
      Deprecated.
      The percentage of the total slider that constitutes one discrete step. The slider will move one step when the appropriate arrow key is pressed.

      If this method is called after the component has been drawn/initialized: Sets the stepPercent property of the slider
      Parameters:
      stepPercent - new slider step percent. Default value is 5
      Returns:
      Slider instance, for chaining setter calls
    • getStepPercent

      public float getStepPercent()
      Deprecated.
      The percentage of the total slider that constitutes one discrete step. The slider will move one step when the appropriate arrow key is pressed.
      Returns:
      Current stepPercent value. Default value is 5
    • setStepPercent

      public Slider setStepPercent(double stepPercent)
      The percentage of the total slider that constitutes one discrete step. The slider will move one step when the appropriate arrow key is pressed.

      If this method is called after the component has been drawn/initialized: Sets the stepPercent property of the slider
      Parameters:
      stepPercent - new slider step percent. Default value is 5
      Returns:
      Slider instance, for chaining setter calls
    • getStepPercentAsDouble

      public double getStepPercentAsDouble()
      The percentage of the total slider that constitutes one discrete step. The slider will move one step when the appropriate arrow key is pressed.
      Returns:
      Current stepPercent value. Default value is 5
    • setThumbSrc

      public Slider setThumbSrc(String thumbSrc)
      The base filename for the slider thumb images. The filenames for the thumb icons are assembled from this base filename and the state of the thumb, as follows:
      Assume the thumbSrc is set to {baseName}.{extension}
      The full set of images to be displayed is:
      For horizontal sliders:
      • h{baseName}.{extension}: default enabled appearance.
      • h{baseName}_down.{extension}: appearance when the slider is enabled and the thumb is clicked.
      • h{baseName}_Disabled.{extension}: appearance when the slider is disabled.
      For vertical sliders:
      • v{baseName}.{extension}: default enabled appearance.
      • v{baseName}_down.{extension}: appearance when the slider is enabled and the thumb is clicked.
      • v{baseName}_Disabled.{extension}: appearance when the slider is disabled.


      If this method is called after the component has been drawn/initialized: Sets the thumbSrc property of the slider
      Parameters:
      thumbSrc - new thumbSrc. Default value is "thumb.gif"
      Returns:
      Slider instance, for chaining setter calls
    • getThumbSrc

      public String getThumbSrc()
      The base filename for the slider thumb images. The filenames for the thumb icons are assembled from this base filename and the state of the thumb, as follows:
      Assume the thumbSrc is set to {baseName}.{extension}
      The full set of images to be displayed is:
      For horizontal sliders:
      • h{baseName}.{extension}: default enabled appearance.
      • h{baseName}_down.{extension}: appearance when the slider is enabled and the thumb is clicked.
      • h{baseName}_Disabled.{extension}: appearance when the slider is disabled.
      For vertical sliders:
      • v{baseName}.{extension}: default enabled appearance.
      • v{baseName}_down.{extension}: appearance when the slider is enabled and the thumb is clicked.
      • v{baseName}_Disabled.{extension}: appearance when the slider is disabled.
      Returns:
      Current thumbSrc value. Default value is "thumb.gif"
    • setThumbThickWidth

      public Slider setThumbThickWidth(int thumbThickWidth)
      The dimension of the thumb perpendicular to the slider track.

      If this method is called after the component has been drawn/initialized: Sets the thumbThickWidth property of the slider
      Parameters:
      thumbThickWidth - new thumbThickWidth. Default value is 23
      Returns:
      Slider instance, for chaining setter calls
    • getThumbThickWidth

      public int getThumbThickWidth()
      The dimension of the thumb perpendicular to the slider track.
      Returns:
      Current thumbThickWidth value. Default value is 23
    • setThumbThinWidth

      public Slider setThumbThinWidth(int thumbThinWidth)
      The dimension of the thumb parallel to the slider track.

      If this method is called after the component has been drawn/initialized: Sets the thumbThinWidth property of the slider
      Parameters:
      thumbThinWidth - new thumbThinWidth. Default value is 17
      Returns:
      Slider instance, for chaining setter calls
    • getThumbThinWidth

      public int getThumbThinWidth()
      The dimension of the thumb parallel to the slider track.
      Returns:
      Current thumbThinWidth value. Default value is 17
    • setTitle

      public void setTitle(String title)
      Optional display title for the slider.

      If this method is called after the component has been drawn/initialized: Sets the title of the slider
      Overrides:
      setTitle in class Canvas
      Parameters:
      title - new title for the slider. Default value is "Set Value"
      See Also:
    • getTitle

      public String getTitle()
      Optional display title for the slider.
      Overrides:
      getTitle in class Canvas
      Returns:
      Current title value. Default value is "Set Value"
      See Also:
    • setTitleSpacing

      public Slider setTitleSpacing(int titleSpacing)
      The space between the title and the track.
      Parameters:
      titleSpacing - New titleSpacing value. Default value is 5
      Returns:
      Slider instance, for chaining setter calls
    • getTitleSpacing

      public int getTitleSpacing()
      The space between the title and the track.
      Returns:
      Current titleSpacing value. Default value is 5
    • setTitleStyle

      public Slider setTitleStyle(String titleStyle) throws IllegalStateException
      CSS style for the title-text, when showTitle is true.
      Parameters:
      titleStyle - New titleStyle value. Default value is "sliderTitle"
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getTitleStyle

      public String getTitleStyle()
      CSS style for the title-text, when showTitle is true.
      Returns:
      Current titleStyle value. Default value is "sliderTitle"
      See Also:
    • setTrackCapSize

      public Slider setTrackCapSize(int trackCapSize)
      The height of vertical slider start and end images, or width of horizontal slider start and end images.

      If this method is called after the component has been drawn/initialized: Sets the trackCapSize property of the slider
      Parameters:
      trackCapSize - new trackCapSize. Default value is 6
      Returns:
      Slider instance, for chaining setter calls
    • getTrackCapSize

      public int getTrackCapSize()
      The height of vertical slider start and end images, or width of horizontal slider start and end images.
      Returns:
      Current trackCapSize value. Default value is 6
    • setTrackImageType

      public Slider setTrackImageType(ImageStyle trackImageType)
      The imageType setting for the slider track.

      If this method is called after the component has been drawn/initialized: Sets the trackImageType property of the slider
      Parameters:
      trackImageType - new trackImageType. Default value is "stretch"
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getTrackImageType

      public ImageStyle getTrackImageType()
      The imageType setting for the slider track.
      Returns:
      Current trackImageType value. Default value is "stretch"
      See Also:
    • setTrackSrc

      public Slider setTrackSrc(String trackSrc)
      The base filename for the slider track images. The filenames for the track icons are assembled from this base filename and the state of the slider, as follows:
      Assume the trackSrc is set to {baseName}.{extension}
      The full set of images to be displayed is:
      For horizontal sliders:
      • h{baseName}_start.{extension}: start (left edge) of the track for a slider that is enabled.
      • h{baseName}_stretch.{extension}: the track for an enabled slider; this may be centered, tiled, or stretched.
      • h{baseName}_end.{extension}: end (right edge) of the track for a slider that is enabled.
      • h{baseName}_Disabled_start.{extension}: start (left edge) of the track for a slider that is disabled.
      • h{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be centered, tiled, or stretched.
      • h{baseName}_Disabled_end.{extension}: end (right edge) of the track for a slider that is disabled.
      For vertical sliders:
      • v{baseName}_start.{extension}: start (bottom edge) of the track for a slider that is enabled.
      • v{baseName}_stretch.{extension}: the track for an enabled slider; this may be centered, tiled, or stretched.
      • v{baseName}_end.{extension}: end (top edge) of the track for a slider that is enabled.
      • v{baseName}_Disabled_start.{extension}: start (bottom edge) of the track for a slider that is disabled.
      • v{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be centered, tiled, or stretched.
      • v{baseName}_end.{extension}: end (top edge) of the track for a slider that is disabled.


      If this method is called after the component has been drawn/initialized: Sets the trackSrc property of the slider
      Parameters:
      trackSrc - new trackSrc. Default value is "track.gif"
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getTrackSrc

      public String getTrackSrc()
      The base filename for the slider track images. The filenames for the track icons are assembled from this base filename and the state of the slider, as follows:
      Assume the trackSrc is set to {baseName}.{extension}
      The full set of images to be displayed is:
      For horizontal sliders:
      • h{baseName}_start.{extension}: start (left edge) of the track for a slider that is enabled.
      • h{baseName}_stretch.{extension}: the track for an enabled slider; this may be centered, tiled, or stretched.
      • h{baseName}_end.{extension}: end (right edge) of the track for a slider that is enabled.
      • h{baseName}_Disabled_start.{extension}: start (left edge) of the track for a slider that is disabled.
      • h{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be centered, tiled, or stretched.
      • h{baseName}_Disabled_end.{extension}: end (right edge) of the track for a slider that is disabled.
      For vertical sliders:
      • v{baseName}_start.{extension}: start (bottom edge) of the track for a slider that is enabled.
      • v{baseName}_stretch.{extension}: the track for an enabled slider; this may be centered, tiled, or stretched.
      • v{baseName}_end.{extension}: end (top edge) of the track for a slider that is enabled.
      • v{baseName}_Disabled_start.{extension}: start (bottom edge) of the track for a slider that is disabled.
      • v{baseName}_Disabled_stretch.{extension}: the track for a disabled slider; this may be centered, tiled, or stretched.
      • v{baseName}_end.{extension}: end (top edge) of the track for a slider that is disabled.
      Returns:
      Current trackSrc value. Default value is "track.gif"
      See Also:
    • setTrackWidth

      public Slider setTrackWidth(int trackWidth)
      The thickness of the track. This is the width, for a vertical slider, or the height, for a horizontal slider.

      If this method is called after the component has been drawn/initialized: Sets the trackWidth property of the slider
      Parameters:
      trackWidth - new trackWidth. Default value is 7
      Returns:
      Slider instance, for chaining setter calls
    • getTrackWidth

      public int getTrackWidth()
      The thickness of the track. This is the width, for a vertical slider, or the height, for a horizontal slider.
      Returns:
      Current trackWidth value. Default value is 7
    • setValue

      public Slider setValue(float value)
      Deprecated.
      The slider value. This value should lie between the minValue and maxValue and increases as the thumb is moved up (for a vertical slider) or right (for a horizontal slider) unless flipValues is set to true.

      If this method is called after the component has been drawn/initialized: Sets the slider value to newValue and moves the slider thumb to the appropriate position for this value. Sends the 'sliderMove' event to the sliderTarget.
      Parameters:
      value - the new value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 1
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getValue

      public float getValue()
      Deprecated.
      The slider value. This value should lie between the minValue and maxValue and increases as the thumb is moved up (for a vertical slider) or right (for a horizontal slider) unless flipValues is set to true.
      Returns:
      Returns the current slider value. Default value is 1
      See Also:
    • setValue

      public Slider setValue(double value)
      The slider value. This value should lie between the minValue and maxValue and increases as the thumb is moved up (for a vertical slider) or right (for a horizontal slider) unless flipValues is set to true.

      If this method is called after the component has been drawn/initialized: Sets the slider value to newValue and moves the slider thumb to the appropriate position for this value. Sends the 'sliderMove' event to the sliderTarget.
      Parameters:
      value - the new value Note:Use Doubles rather Floats when manipulating decimal values. See GwtFloatVsDouble for details. Default value is 1
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getValueAsDouble

      public double getValueAsDouble()
      The slider value. This value should lie between the minValue and maxValue and increases as the thumb is moved up (for a vertical slider) or right (for a horizontal slider) unless flipValues is set to true.
      Returns:
      Returns the current slider value. Default value is 1
      See Also:
    • setValueFormat

      public Slider setValueFormat(String valueFormat) throws IllegalStateException
      FormatString for numeric formatting of the value and range labels.
      Parameters:
      valueFormat - New valueFormat value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getValueFormat

      public String getValueFormat()
      FormatString for numeric formatting of the value and range labels.
      Returns:
      Current valueFormat value. Default value is null
      See Also:
    • getValueLabel

      public Label getValueLabel() throws IllegalStateException
      com.smartgwt.client.types.AutoChild displaying the current value as a floating label when showValue is true.

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

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

      public Slider setValueStyle(String valueStyle) throws IllegalStateException
      CSS style for the floating valueLabel, visible when showValue is true.
      Parameters:
      valueStyle - New valueStyle value. Default value is "sliderValue"
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getValueStyle

      public String getValueStyle()
      CSS style for the floating valueLabel, visible when showValue is true.
      Returns:
      Current valueStyle value. Default value is "sliderValue"
      See Also:
    • setValueTextStyle

      public Slider setValueTextStyle(String valueTextStyle) throws IllegalStateException
      CSS style for the text in the floating valueLabel, visible when showValue is true.
      Parameters:
      valueTextStyle - New valueTextStyle value. Default value is "sliderValueText"
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getValueTextStyle

      public String getValueTextStyle()
      CSS style for the text in the floating valueLabel, visible when showValue is true.
      Returns:
      Current valueTextStyle value. Default value is "sliderValueText"
      See Also:
    • setVertical

      public Slider setVertical(Boolean vertical)
      Indicates whether this is a vertical or horizontal slider.

      If this method is called after the component has been drawn/initialized: Sets the vertical property of the slider
      Parameters:
      vertical - is the slider vertical. Default value is true
      Returns:
      Slider instance, for chaining setter calls
      See Also:
    • getVertical

      public Boolean getVertical()
      Indicates whether this is a vertical or horizontal slider.
      Returns:
      Current vertical value. Default value is true
      See Also:
    • setVLabelSpacing

      public Slider setVLabelSpacing(Integer vLabelSpacing)
      The space around the labels used to display the minimum, maximum and current values of the slider, when vertical is true. If unset, defaults to labelSpacing.
      Parameters:
      vLabelSpacing - New vLabelSpacing value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
    • getVLabelSpacing

      public Integer getVLabelSpacing()
      The space around the labels used to display the minimum, maximum and current values of the slider, when vertical is true. If unset, defaults to labelSpacing.
      Returns:
      Current vLabelSpacing value. Default value is null
    • setVThumbStyle

      public Slider setVThumbStyle(String vThumbStyle) throws IllegalStateException
      Optional CSS style for the thumb for a vertically oriented slider. See hThumbStyle for state suffixes.
      Parameters:
      vThumbStyle - New vThumbStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getVThumbStyle

      public String getVThumbStyle()
      Optional CSS style for the thumb for a vertically oriented slider. See hThumbStyle for state suffixes.
      Returns:
      Current vThumbStyle value. Default value is null
      See Also:
    • setVTrackStyle

      public Slider setVTrackStyle(String vTrackStyle) throws IllegalStateException
      Optional CSS style for the track for a vertically oriented slider.

      Will have the suffix "Disabled" added when the slider is disabled.

      Parameters:
      vTrackStyle - New vTrackStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getVTrackStyle

      public String getVTrackStyle()
      Optional CSS style for the track for a vertically oriented slider.

      Will have the suffix "Disabled" added when the slider is disabled.

      Returns:
      Current vTrackStyle value. Default value is null
      See Also:
    • setVValueStyle

      public Slider setVValueStyle(String vValueStyle) throws IllegalStateException
      Optional CSS style for the floating valueLabel, visible when showValue is true and vertical is true.
      Parameters:
      vValueStyle - New vValueStyle value. Default value is null
      Returns:
      Slider instance, for chaining setter calls
      Throws:
      IllegalStateException - this property cannot be changed after the component has been created
      See Also:
    • getVValueStyle

      public String getVValueStyle()
      Optional CSS style for the floating valueLabel, visible when showValue is true and vertical is true.
      Returns:
      Current vValueStyle value. Default value is null
      See Also:
    • addValueChangedHandler

      public HandlerRegistration addValueChangedHandler(ValueChangedHandler handler)
      Add a valueChanged handler.

      This method is called when the slider value changes. This occurs when the setValue() method is called, or when the slider is moved. Add a notification to be fired whenever the slider value changes.

      Specified by:
      addValueChangedHandler in interface HasValueChangedHandlers
      Parameters:
      handler - the valueChanged handler
      Returns:
      HandlerRegistration used to remove this handler
    • valueIsChanging

      public Boolean valueIsChanging()
      Call this method in your Slider.valueChanged() handler to determine whether the value change is due to an ongoing drag interaction (true) or due to a thumb-release, mouse click, keypress, or programmatic event (false). You may choose to execute temporary or partial updates while the slider thumb is dragged, and final updates or persistence of the value in response to the other events.
      Returns:
      true if user is still dragging the slider thumb, false otherwise
    • setDefaultProperties

      public static void setDefaultProperties(Slider sliderProperties)
      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:
      sliderProperties - properties that should be used as new defaults when instances of this class are created
      See Also:
    • setLogicalStructure

      public LogicalStructureObject setLogicalStructure(SliderLogicalStructure 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