Class Scroller

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.orderedlayout.Scroller
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier<Scroller>, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable<Scroller>, com.vaadin.flow.component.FocusNotifier<Scroller>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, com.vaadin.flow.component.HasTheme, HasThemeVariant<ScrollerVariant>, Serializable

@Tag("vaadin-scroller") @NpmPackage(value="@vaadin/scroller", version="25.0.0-alpha16") @JsModule("@vaadin/scroller/src/vaadin-scroller.js") public class Scroller extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.Focusable<Scroller>, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, HasThemeVariant<ScrollerVariant>
Scroller is a component container which enables scrolling overflowing content. Scroll direction can be configured with setScrollDirection(ScrollDirection)
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Enum for the values of the ScrollDirection property.

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier

    com.vaadin.flow.component.BlurNotifier.BlurEvent<C extends com.vaadin.flow.component.Component>

    Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier

    com.vaadin.flow.component.FocusNotifier.FocusEvent<C extends com.vaadin.flow.component.Component>
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs an empty scroller.
    Scroller(com.vaadin.flow.component.Component content)
    Convenience constructor to create a scroller with the given content.
    Scroller(com.vaadin.flow.component.Component content, Scroller.ScrollDirection scrollDirection)
    Convenience constructor to create a scroller with the given content and scroll direction.
    Convenience constructor to create an empty scroller with the given scroll direction.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.component.Component
    Gets the content of this scroller.
    Returns the scroll direction for this scroller.
    void
    Scrolls the scroller to the bottom.
    void
    Scrolls the scroller to the top.
    void
    setContent(com.vaadin.flow.component.Component content)
    Sets the content of this scroller.
    void
    Sets the scroll direction for this scroller.

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.BlurNotifier

    addBlurListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.Focusable

    addFocusShortcut, blur, focus, getTabIndex, setTabIndex

    Methods inherited from interface com.vaadin.flow.component.FocusNotifier

    addFocusListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasEnabled

    isEnabled, setEnabled

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName

    Methods inherited from interface com.vaadin.flow.component.HasTheme

    addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName

    Methods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant

    addThemeVariants, removeThemeVariants
  • Constructor Details

  • Method Details

    • setContent

      public void setContent(com.vaadin.flow.component.Component content)
      Sets the content of this scroller. The content must always be set, either with a constructor parameter or by calling this method.
      Parameters:
      content - a component to use as content
    • getContent

      public com.vaadin.flow.component.Component getContent()
      Gets the content of this scroller.
      Returns:
      the component used as content
    • setScrollDirection

      public void setScrollDirection(Scroller.ScrollDirection scrollDirection)
      Sets the scroll direction for this scroller. Defaults to Scroller.ScrollDirection.BOTH.
      Parameters:
      scrollDirection - Scroller.ScrollDirection.BOTH to enable both vertical and horizontal scrollbars. Scroller.ScrollDirection.HORIZONTAL to enable only horizontal scrollbars. Scroller.ScrollDirection.VERTICAL to enable only vertical scrollbars. Scroller.ScrollDirection.NONE to disable both vertical and horizontal scrollbars.
    • getScrollDirection

      public Scroller.ScrollDirection getScrollDirection()
      Returns the scroll direction for this scroller.
      Returns:
      the scroll direction for this scroller.
      See Also:
    • scrollToTop

      public void scrollToTop()
      Scrolls the scroller to the top.
    • scrollToBottom

      public void scrollToBottom()
      Scrolls the scroller to the bottom.