Package com.vaadin.client.widget.grid
Class AutoScroller
- java.lang.Object
-
- com.vaadin.client.widget.grid.AutoScroller
-
public class AutoScroller extends Object
A class for handling automatic scrolling vertically / horizontally in the Grid when the cursor is close enough the edge of the body of the grid, depending on the scroll direction chosen.- Since:
- 7.5.0
- Author:
- Vaadin Ltd
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceAutoScroller.AutoScrollerCallbackCallback that notifies when the cursor is on top of a new row or column because of the automatic scrolling.static classAutoScroller.ScrollAxisScroll direction for automatic scrolling.
-
Constructor Summary
Constructors Constructor Description AutoScroller(Grid<?> grid)Creates a new instance for scrolling the given grid.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description doublegetFrozenColumnsWidth()Returns how wide the frozen columns are all counted together.intgetScrollArea()Returns the size of the auto scroll area in pixels.voidsetScrollArea(int px)Set the auto scroll area height or width depending on the scrolling axis.voidstart(com.google.gwt.dom.client.NativeEvent startEvent, AutoScroller.ScrollAxis scrollAxis, AutoScroller.AutoScrollerCallback callback)Starts the automatic scrolling detection.voidstop()Stops the automatic scrolling.
-
-
-
Constructor Detail
-
AutoScroller
public AutoScroller(Grid<?> grid)
Creates a new instance for scrolling the given grid.- Parameters:
grid- the grid to auto scroll
-
-
Method Detail
-
start
public void start(com.google.gwt.dom.client.NativeEvent startEvent, AutoScroller.ScrollAxis scrollAxis, AutoScroller.AutoScrollerCallback callback)Starts the automatic scrolling detection.- Parameters:
startEvent- the event that starts the automatic scrollscrollAxis- the axis along which the scrolling should happencallback- the callback for getting info about the automatic scrolling
-
stop
public void stop()
Stops the automatic scrolling.
-
setScrollArea
public void setScrollArea(int px)
Set the auto scroll area height or width depending on the scrolling axis. This is the amount of pixels from the edge of the grid that the scroll is triggered.Defaults to 100px.
- Parameters:
px- the pixel height/width for the auto scroll area depending on direction
-
getScrollArea
public int getScrollArea()
Returns the size of the auto scroll area in pixels.Defaults to 100px.
- Returns:
- size in pixels
-
getFrozenColumnsWidth
public double getFrozenColumnsWidth()
Returns how wide the frozen columns are all counted together.- Returns:
- the width of frozen columns
-
-