Class ScrollbarEvent

Direct Known Subclasses:
ScrollEndEvent, ScrollEvent

public abstract class ScrollbarEvent extends ClientEvent<ScrollListener>
Abstract base class for scroll-related events that carry scroll position information.

Scroll events provide the current scroll position in all four directions, along with the total scrollable dimensions of the element.

  • Constructor Details

    • ScrollbarEvent

      public ScrollbarEvent(Float scrollTop, Float scrollBottom, Float scrollHeight, Float scrollLeft, Float scrollRight, Float scrollWidth)
      Creates a ScrollbarEvent with the specified scroll positions.
      Parameters:
      scrollTop - the distance scrolled from the top, in pixels
      scrollBottom - the distance from the bottom of the scrollable area, in pixels
      scrollHeight - the total scrollable height, in pixels
      scrollLeft - the distance scrolled from the left, in pixels
      scrollRight - the distance from the right of the scrollable area, in pixels
      scrollWidth - the total scrollable width, in pixels
  • Method Details

    • getScrollTop

      public int getScrollTop()
      Returns the distance scrolled from the top.
      Returns:
      the scroll top position in pixels
    • getScrollBottom

      public int getScrollBottom()
      Returns the distance from the bottom of the scrollable area.
      Returns:
      the scroll bottom position in pixels
    • getScrollHeight

      public int getScrollHeight()
      Returns the total scrollable height.
      Returns:
      the scroll height in pixels
    • getScrollLeft

      public int getScrollLeft()
      Returns the distance scrolled from the left.
      Returns:
      the scroll left position in pixels
    • getScrollRight

      public int getScrollRight()
      Returns the distance from the right of the scrollable area.
      Returns:
      the scroll right position in pixels
    • getScrollWidth

      public int getScrollWidth()
      Returns the total scrollable width.
      Returns:
      the scroll width in pixels