Class Scroller
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.orderedlayout.Scroller
- All Implemented Interfaces:
AttachNotifier,BlurNotifier<Scroller>,DetachNotifier,Focusable<Scroller>,FocusNotifier<Scroller>,HasElement,HasEnabled,HasSize,HasStyle,HasTheme,HasThemeVariant<ScrollerVariant>,Serializable
@Tag("vaadin-scroller")
@NpmPackage(value="@vaadin/scroller",
version="25.0.0-beta4")
@JsModule("@vaadin/scroller/src/vaadin-scroller.js")
public class Scroller
extends Component
implements Focusable<Scroller>, HasSize, 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 ClassesModifier and TypeClassDescriptionstatic enumEnum for the values of the ScrollDirection property.Nested classes/interfaces inherited from interface com.vaadin.flow.component.BlurNotifier
BlurNotifier.BlurEvent<C extends Component>Nested classes/interfaces inherited from interface com.vaadin.flow.component.FocusNotifier
FocusNotifier.FocusEvent<C extends Component> -
Constructor Summary
ConstructorsConstructorDescriptionScroller()Constructs an empty scroller.Convenience constructor to create a scroller with the given content.Scroller(Component content, Scroller.ScrollDirection scrollDirection) Convenience constructor to create a scroller with the given content and scroll direction.Scroller(Scroller.ScrollDirection scrollDirection) Convenience constructor to create an empty scroller with the given scroll direction. -
Method Summary
Modifier and TypeMethodDescriptionGets the content of this scroller.Returns the scroll direction for this scroller.voidScrolls the scroller to the bottom.voidScrolls the scroller to the top.voidsetContent(Component content) Sets the content of this scroller.voidsetScrollDirection(Scroller.ScrollDirection scrollDirection) 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, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.BlurNotifier
addBlurListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.Focusable
addFocusShortcut, blur, focus, getTabIndex, setTabIndexMethods inherited from interface com.vaadin.flow.component.FocusNotifier
addFocusListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods 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, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeNameMethods inherited from interface com.vaadin.flow.component.shared.HasThemeVariant
addThemeVariants, removeThemeVariants, setThemeVariant, setThemeVariants, setThemeVariants
-
Constructor Details
-
Scroller
public Scroller()Constructs an empty scroller. Content can be set withsetContent(Component)and scroll direction defaults toScroller.ScrollDirection.BOTHand can be set withsetScrollDirection(ScrollDirection). -
Scroller
Convenience constructor to create a scroller with the given content. Scroll direction defaults toScroller.ScrollDirection.BOTHand can be set withsetScrollDirection(ScrollDirection).- Parameters:
content- the content of this scroller- See Also:
-
Scroller
Convenience constructor to create a scroller with the given content and scroll direction.- Parameters:
content- the content of this scrollerscrollDirection- scroll direction that the scroller will have
-
Scroller
Convenience constructor to create an empty scroller with the given scroll direction. Content can be set withsetContent(Component)- Parameters:
scrollDirection- scroll direction that the scroller will have
-
-
Method Details
-
setContent
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
Gets the content of this scroller.- Returns:
- the component used as content
-
setScrollDirection
Sets the scroll direction for this scroller. Defaults toScroller.ScrollDirection.BOTH.- Parameters:
scrollDirection-Scroller.ScrollDirection.BOTHto enable both vertical and horizontal scrollbars.Scroller.ScrollDirection.HORIZONTALto enable only horizontal scrollbars.Scroller.ScrollDirection.VERTICALto enable only vertical scrollbars.Scroller.ScrollDirection.NONEto disable both vertical and horizontal scrollbars.
-
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.
-