Class NativeVerticalScrollbar

All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasHandlers, EventListener, HasVerticalScrolling, HasVisibility, IsWidget, VerticalScrollbar

public class NativeVerticalScrollbar extends AbstractNativeScrollbar implements VerticalScrollbar
A vertical 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

    • getMaximumVerticalScrollPosition

      public int getMaximumVerticalScrollPosition()
      Description copied from interface: HasVerticalScrolling
      Get the maximum position of vertical scrolling. This is usually the scrollHeight - clientHeight.
      Specified by:
      getMaximumVerticalScrollPosition in interface HasVerticalScrolling
      Returns:
      the maximum vertical scroll position
    • getMinimumVerticalScrollPosition

      public int getMinimumVerticalScrollPosition()
      Description copied from interface: HasVerticalScrolling
      Get the minimum position of vertical scrolling.
      Specified by:
      getMinimumVerticalScrollPosition in interface HasVerticalScrolling
      Returns:
      the minimum vertical scroll position
    • getScrollHeight

      public int getScrollHeight()
      Get the height in pixels of the scrollable content that the scrollbar controls.

      This is not the same as the maximum scroll top position. The maximum scroll position equals the scrollHeight- offsetHeight;

      Specified by:
      getScrollHeight in interface VerticalScrollbar
      Returns:
      the scroll height
      See Also:
    • getVerticalScrollPosition

      public int getVerticalScrollPosition()
      Description copied from interface: HasVerticalScrolling
      Gets the vertical scroll position.
      Specified by:
      getVerticalScrollPosition in interface HasVerticalScrolling
      Returns:
      the vertical scroll position, in pixels
    • setScrollHeight

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

      This is not the same as the maximum scroll top position. The maximum scroll position equals the scrollHeight- offsetHeight;

      Specified by:
      setScrollHeight in interface VerticalScrollbar
      Parameters:
      height - the size height pixels
    • setVerticalScrollPosition

      public void setVerticalScrollPosition(int position)
      Description copied from interface: HasVerticalScrolling
      Sets the vertical scroll position.
      Specified by:
      setVerticalScrollPosition in interface HasVerticalScrolling
      Parameters:
      position - the new vertical scroll position, in pixels
    • getNativeWidth

      protected int getNativeWidth()
      Get the width of the scrollbar.
      Returns:
      the width 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