Class ScrollContainer

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.featurepack.desktop.AbstractContainer
com.vaadin.featurepack.desktop.ScrollContainer
All Implemented Interfaces:
HasLayout, com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.BlurNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.Focusable, com.vaadin.flow.component.FocusNotifier, com.vaadin.flow.component.HasComponents, com.vaadin.flow.component.HasComponentsOfType<com.vaadin.flow.component.Component>, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasEnabled, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

@Tag("div") @StyleSheet("context://vfp-scroll-container.css") public class ScrollContainer extends AbstractContainer
ScrollContainer is a container component that provides a scrollable view.
Author:
Vaadin Ltd
See Also:
  • Nested Class Summary

    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.Focusable

    com.vaadin.flow.component.Focusable.FocusJs

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

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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Used to set the horizontal scrollbar mode so that horizontal scrollbars are displayed only when needed.
    static final int
    Used to set the horizontal scrollbar mode so that horizontal scrollbars are never displayed.
    static final int
    Used to set the horizontal scrollbar mode so that horizontal scrollbars are always displayed.
    protected int
    The display mode for the horizontal scrollbar.
    static final int
    Used to set the vertical scrollbar mode so that vertical scrollbars are displayed only when needed.
    static final int
    Used to set the vertical scrollbar mode so that vertical scrollbars are never displayed.
    static final int
    Used to set the vertical scrollbar mode so that vertical scrollbars are always displayed.
    protected int
    The display mode for the vertical scrollbar.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    ScrollContainer(int verticalScrollbarMode, int horizontalScrollbarMode)
    Creates a new scroll container with the given vertical and horizontal scrollbar modes.
    ScrollContainer(com.vaadin.flow.component.Component view)
    Creates a new scroll container with the given view component.
    ScrollContainer(com.vaadin.flow.component.Component view, int verticalScrollbarMode, int horizontalScrollbarMode)
    Creates a new scroll container with the given view component and scroll bar modes.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the mode for the horizontal scrollbar.
    int
    Gets the mode for the vertical scrollbar.
    com.vaadin.flow.component.Component
    Gets the view component for this scroll container.
    void
    Sets the mode for the horizontal scrollbar.
    void
    Sets the mode for the vertical scrollbar.
    void
    setViewportView(com.vaadin.flow.component.Component view)
    Sets the view component for this scroll container.

    Methods inherited from class com.vaadin.featurepack.desktop.AbstractContainer

    add, getComponent, getComponentCount, getInsets, getLayout, remove, removeAll, setLayout

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

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

    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, focus, getTabIndex, setTabIndex

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

    addFocusListener

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

    add

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

    add, addComponentAsFirst, addComponentAtIndex, bindChildren, getChildren, getComponentAt, indexOf, remove, replace

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

    getElement

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

    bindEnabled, isEnabled, setEnabled

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

    bindHeight, bindWidth, 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, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

    • VERTICAL_SCROLLBAR_AUTO

      public static final int VERTICAL_SCROLLBAR_AUTO
      Used to set the vertical scrollbar mode so that vertical scrollbars are displayed only when needed.
      See Also:
    • VERTICAL_SCROLLBAR_HIDDEN

      public static final int VERTICAL_SCROLLBAR_HIDDEN
      Used to set the vertical scrollbar mode so that vertical scrollbars are never displayed.
      See Also:
    • VERTICAL_SCROLLBAR_VISIBLE

      public static final int VERTICAL_SCROLLBAR_VISIBLE
      Used to set the vertical scrollbar mode so that vertical scrollbars are always displayed.
      See Also:
    • HORIZONTAL_SCROLLBAR_AUTO

      public static final int HORIZONTAL_SCROLLBAR_AUTO
      Used to set the horizontal scrollbar mode so that horizontal scrollbars are displayed only when needed.
      See Also:
    • HORIZONTAL_SCROLLBAR_HIDDEN

      public static final int HORIZONTAL_SCROLLBAR_HIDDEN
      Used to set the horizontal scrollbar mode so that horizontal scrollbars are never displayed.
      See Also:
    • HORIZONTAL_SCROLLBAR_VISIBLE

      public static final int HORIZONTAL_SCROLLBAR_VISIBLE
      Used to set the horizontal scrollbar mode so that horizontal scrollbars are always displayed.
      See Also:
    • verticalScrollbarMode

      protected int verticalScrollbarMode
      The display mode for the vertical scrollbar.
    • horizontalScrollbarMode

      protected int horizontalScrollbarMode
      The display mode for the horizontal scrollbar.
  • Constructor Details

    • ScrollContainer

      public ScrollContainer()
    • ScrollContainer

      public ScrollContainer(int verticalScrollbarMode, int horizontalScrollbarMode)
      Creates a new scroll container with the given vertical and horizontal scrollbar modes.
      Parameters:
      verticalScrollbarMode - the vertical scrollbar mode
      horizontalScrollbarMode - the horizontal scrollbar mode
    • ScrollContainer

      public ScrollContainer(com.vaadin.flow.component.Component view)
      Creates a new scroll container with the given view component.
      Parameters:
      view - the view component to display
    • ScrollContainer

      public ScrollContainer(com.vaadin.flow.component.Component view, int verticalScrollbarMode, int horizontalScrollbarMode)
      Creates a new scroll container with the given view component and scroll bar modes.
      Parameters:
      view - the view component to display
      verticalScrollbarMode - the vertical scrollbar mode
      horizontalScrollbarMode - the horizontal scrollbar mode
  • Method Details

    • setViewportView

      public void setViewportView(com.vaadin.flow.component.Component view)
      Sets the view component for this scroll container.
      Parameters:
      view - the view component to display
    • getViewportView

      public com.vaadin.flow.component.Component getViewportView()
      Gets the view component for this scroll container.
      Returns:
      the view component, or null if no view component is set
    • setVerticalScrollbarMode

      public void setVerticalScrollbarMode(int mode)
      Sets the mode for the vertical scrollbar.
      Parameters:
      mode - the vertical scrollbar mode
    • getVerticalScrollbarMode

      public int getVerticalScrollbarMode()
      Gets the mode for the vertical scrollbar.
      Returns:
      the vertical scrollbar mode
    • setHorizontalScrollbarMode

      public void setHorizontalScrollbarMode(int mode)
      Sets the mode for the horizontal scrollbar.
      Parameters:
      mode - the horizontal scrollbar mode
    • getHorizontalScrollbarMode

      public int getHorizontalScrollbarMode()
      Gets the mode for the horizontal scrollbar.
      Returns:
      the horizontal scrollbar mode