# Interface SyScrollBarType

All Superinterfaces:
  `SyActiveReadableType, SyActiveType, SyBoundedReadableType<SySpaceParentRelativeType>, SyBoundedType<SySpaceParentRelativeType>, SyComponentReadableType, SyComponentType, SyEventReceiverType, SyKeyboardFocusableReadableType, SyKeyboardFocusableType, SyMouseFocusAcceptingReadableType, SyMouseFocusAcceptingType, SyScrollBarReadableType, SySizedReadableType<SySpaceParentRelativeType>, SySizedType<SySpaceParentRelativeType>, SyThemeableReadableType, SyThemeableType, SyVisibleReadableType, SyVisibleType`

All Known Subinterfaces:
  `SyScrollBarHorizontalType, SyScrollBarVerticalType`

public interface SyScrollBarType extends SyScrollBarReadableType, SyComponentType
Write access to scrollbars.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `removeOnThumbDragListener()`
  Remove any listeners that are executed when the thumb is dragged.
  `void`
  `setHideIfDisabled(SyScrollBarHideIfDisabled hideIfDisabled)`
  Allow for hiding the scrollbar if it is disabled.
  `void`
  `setOnThumbDragListener(Consumer<SyScrollBarDrag> listener)`
  Set a listener that will be executed when the thumb is dragged.
  `void`
  `setScrollAmountShown(double amount)`
  Scrollbars are typically used to scroll a visible portion of some larger structure.
  `void`
  `setScrollPosition(double position)`
  Set the scroll position in the range `[0, 1]`.
  `void`
  `setScrollPositionSnapping(double fraction)`
  Set the scroll position snapping value in the range `[0, 1]`.

  ### Methods inherited from interface SyActiveReadableType

  `isMouseOver`

  ### Methods inherited from interface SyActiveType

  `activity, setActive`

  ### Methods inherited from interface SyBoundedReadableType

  `boundingArea`

  ### Methods inherited from interface SyBoundedType

  `position, setPosition`

  ### Methods inherited from interface SyComponentReadableType

  `ancestorMatchingReadable, childCount, isActive, isVisible, nodeReadable, relativePositionOf, screen, viewportPositionOf, windowReadable`

  ### Methods inherited from interface SyComponentType

  `ancestorMatching, childAdd, childRemove, childrenClear, componentForWindowRelative, layout, node, window`

  ### Methods inherited from interface SyEventReceiverType

  `eventSend`

  ### Methods inherited from interface SyKeyboardFocusableType

  `keyboardFocusBehavior`

  ### Methods inherited from interface SyMouseFocusAcceptingReadableType

  `isMouseQueryAccepting`

  ### Methods inherited from interface SyMouseFocusAcceptingType

  `setMouseQueryAccepting`

  ### Methods inherited from interface SyScrollBarReadableType

  `scrollAmountShown, scrollIncrementSize, scrollPosition, scrollPositionSnapping, thumb, track`

  ### Methods inherited from interface SySizedType

  `setSize, setSizeUpperLimit, size, sizeUpperLimit`

  ### Methods inherited from interface SyThemeableReadableType

  `themeClassesDefaultForComponent, themeClassesExtra, themeClassesInPreferenceOrder`

  ### Methods inherited from interface SyVisibleType

  `setVisible, visibility`

- ## Method Details

  - ### setHideIfDisabled

    void setHideIfDisabled(SyScrollBarHideIfDisabled hideIfDisabled)
    Allow for hiding the scrollbar if it is disabled. If hiding-if-disabled is enabled, then the scrollbar's size will collapse to zero when `SyComponentType.layout(SyLayoutContextType, SyConstraints)` is called and the scrollbar is disabled.
    Parameters:
      `hideIfDisabled` - The hide-if-disabled setting

  - ### setScrollPosition

    void setScrollPosition(double position)
    Set the scroll position in the range `[0, 1]`.
    Parameters:
      `position` - The position

  - ### setScrollPositionSnapping

    void setScrollPositionSnapping(double fraction)
    Set the scroll position snapping value in the range `[0, 1]`. The given fraction is used to determine how many divisions will be used within the scrolling space. For example, a value of `1.0 / 4.0` will yield four possible snapped position values.
    Parameters:
      `fraction` - The fraction

  - ### setScrollAmountShown

    void setScrollAmountShown(double amount)
    Scrollbars are typically used to scroll a visible portion of some larger structure. Some implementations might want to scale the scrollbar thumb based on the portion of the visible space that is visible. A value of `0.0` means that an infinitely small piece of the larger structure is visible. A value of `1.0` means that the entirety of the larger structure is visible.
    Parameters:
      `amount` - The amount shown

  - ### setOnThumbDragListener

    void setOnThumbDragListener(Consumer<SyScrollBarDrag> listener)
    Set a listener that will be executed when the thumb is dragged.
    Parameters:
      `listener` - The listener

  - ### removeOnThumbDragListener

    void removeOnThumbDragListener()
    Remove any listeners that are executed when the thumb is dragged.
    See Also:
      - `setOnThumbDragListener(Consumer)`