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.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable
@Tag("vaadin-scroller") @NpmPackage(value="@vaadin/polymer-legacy-adapter",version="23.0.1") @NpmPackage(value="@vaadin/scroller",version="23.0.1") @NpmPackage(value="@vaadin/vaadin-ordered-layout",version="23.0.1") @JsModule("@vaadin/polymer-legacy-adapter/style-modules.js") @JsModule("@vaadin/scroller/vaadin-scroller.js") public class Scroller extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyleScroller is a component container which enables scrolling overflowing content. Scroll direction can be configured withsetScrollDirection(ScrollDirection)- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classScroller.ScrollDirectionEnum for the values of the ScrollDirection property.
-
Constructor Summary
Constructors Constructor Description Scroller()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.Scroller(Scroller.ScrollDirection scrollDirection)Convenience constructor to create an empty scroller with the given scroll direction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.vaadin.flow.component.ComponentgetContent()Gets the content of this scroller.Scroller.ScrollDirectiongetScrollDirection()Returns the scroll direction for this scroller.voidsetContent(com.vaadin.flow.component.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, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, onEnabledStateChanged, 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.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
-
-
-
-
Constructor Detail
-
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
public Scroller(com.vaadin.flow.component.Component content)
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:
setContent(Component)
-
Scroller
public Scroller(com.vaadin.flow.component.Component content, Scroller.ScrollDirection scrollDirection)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
public Scroller(Scroller.ScrollDirection scrollDirection)
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 Detail
-
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 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
public Scroller.ScrollDirection getScrollDirection()
Returns the scroll direction for this scroller.- Returns:
- the scroll direction for this scroller.
- See Also:
setScrollDirection(ScrollDirection)
-
-