Class NativeHorizontalScrollbar

All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasHandlers, EventListener, HasHorizontalScrolling, HasVisibility, HorizontalScrollbar, IsWidget

public class NativeHorizontalScrollbar extends AbstractNativeScrollbar implements HorizontalScrollbar
A horizontal scrollbar implemented using the browsers native scrollbar.
  • Field Details

    • contentDiv

      @UiField Element contentDiv
      The div inside the scrollable div that forces scrollbars to appear.
    • scrollable

      @UiField Element scrollable
      The scrollable div used to create a scrollbar.
  • Constructor Details

  • Method Details

    • getHorizontalScrollPosition

      public int getHorizontalScrollPosition()
      Description copied from interface: HasHorizontalScrolling
      Gets the horizontal scroll position.
      Specified by:
      getHorizontalScrollPosition in interface HasHorizontalScrolling
      Returns:
      the horizontal scroll position, in pixels
    • getMaximumHorizontalScrollPosition

      public int getMaximumHorizontalScrollPosition()
      Description copied from interface: HasHorizontalScrolling
      Get the maximum position of horizontal scrolling. This is usually the scrollWidth - clientWidth.
      Specified by:
      getMaximumHorizontalScrollPosition in interface HasHorizontalScrolling
      Returns:
      the maximum horizontal scroll position
    • getMinimumHorizontalScrollPosition

      public int getMinimumHorizontalScrollPosition()
      Description copied from interface: HasHorizontalScrolling
      Get the minimum position of horizontal scrolling.
      Specified by:
      getMinimumHorizontalScrollPosition in interface HasHorizontalScrolling
      Returns:
      the minimum horizontal scroll position
    • getScrollWidth

      public int getScrollWidth()
      Get the width in pixels of the scrollable content that the scrollbar controls.

      This is not the same as the maximum scroll left position. The maximum scroll position equals the scrollWidth - offsetWidth;

      Specified by:
      getScrollWidth in interface HorizontalScrollbar
      Returns:
      the scroll width
      See Also:
    • setHorizontalScrollPosition

      public void setHorizontalScrollPosition(int position)
      Description copied from interface: HasHorizontalScrolling
      Sets the horizontal scroll position.
      Specified by:
      setHorizontalScrollPosition in interface HasHorizontalScrolling
      Parameters:
      position - the new horizontal scroll position, in pixels
    • setScrollWidth

      public void setScrollWidth(int width)
      Set the width in pixels of the scrollable content that the scrollbar controls.

      This is not the same as the maximum scroll left position. The maximum scroll position equals the scrollWidth - offsetWidth;

      Specified by:
      setScrollWidth in interface HorizontalScrollbar
      Parameters:
      width - the size width pixels
    • getNativeHeight

      protected int getNativeHeight()
      Get the height of the scrollbar.
      Returns:
      the height of the scrollbar in pixels
    • getScrollableElement

      protected Element getScrollableElement()
      Description copied from class: AbstractNativeScrollbar
      Get the scrollable element.
      Specified by:
      getScrollableElement in class AbstractNativeScrollbar
      Returns:
      the scrollable element