Class AbstractNativeScrollbar

All Implemented Interfaces:
HasScrollHandlers, HasAttachHandlers, HasHandlers, EventListener, HasVisibility, IsWidget
Direct Known Subclasses:
NativeHorizontalScrollbar, NativeVerticalScrollbar

public abstract class AbstractNativeScrollbar extends Widget implements HasScrollHandlers
Abstract parent class for scrollbars implemented using the native browser scrollbars.
  • Constructor Details

    • AbstractNativeScrollbar

      public AbstractNativeScrollbar()
  • Method Details

    • getNativeScrollbarHeight

      public static int getNativeScrollbarHeight()
      Get the height of a native horizontal scrollbar.

      This method assumes that all native scrollbars on the page have the same height.

      Returns:
      the height in pixels
    • getNativeScrollbarWidth

      public static int getNativeScrollbarWidth()
      Get the width of a native vertical scrollbar.

      This method assumes that all native vertical scrollbars on the page have the same width.

      Returns:
      the height in pixels
    • isScrollbarLeftAlignedInRtl

      public static boolean isScrollbarLeftAlignedInRtl()
      Check whether or not the native vertical scrollbar is aligned on the left side of the scrollable element in RTL mode.
      Returns:
      true if left aligned, false if not
    • addScrollHandler

      public HandlerRegistration addScrollHandler(ScrollHandler handler)
      Description copied from interface: HasScrollHandlers
      Adds a ScrollEvent handler.
      Specified by:
      addScrollHandler in interface HasScrollHandlers
      Parameters:
      handler - the scroll handler
      Returns:
      HandlerRegistration used to remove this handler
    • getScrollableElement

      protected abstract Element getScrollableElement()
      Get the scrollable element.
      Returns:
      the scrollable element
    • onAttach

      protected void onAttach()
      Description copied from class: Widget

      This method is called when a widget is attached to the browser's document. To receive notification after a Widget has been added to the document, override the Widget.onLoad() method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).

      It is strongly recommended that you override Widget.onLoad() or Widget.doAttachChildren() instead of this method to avoid inconsistencies between logical and physical attachment states.

      Subclasses that override this method must call super.onAttach() to ensure that the Widget has been attached to its underlying Element.

      Overrides:
      onAttach in class Widget
      See Also:
    • onDetach

      protected void onDetach()
      Description copied from class: Widget

      This method is called when a widget is detached from the browser's document. To receive notification before a Widget is removed from the document, override the Widget.onUnload() method or use Widget.addAttachHandler(com.google.gwt.event.logical.shared.AttachEvent.Handler).

      It is strongly recommended that you override Widget.onUnload() or Widget.doDetachChildren() instead of this method to avoid inconsistencies between logical and physical attachment states.

      Subclasses that override this method must call super.onDetach() to ensure that the Widget has been detached from the underlying Element. Failure to do so will result in application memory leaks due to circular references between DOM Elements and JavaScript objects.

      Overrides:
      onDetach in class Widget
      See Also: