com.vaadin.client.widget.grid
Class AutoScroller

java.lang.Object
  extended by com.vaadin.client.widget.grid.AutoScroller

public class AutoScroller
extends java.lang.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
static interface AutoScroller.AutoScrollerCallback
          Callback that notifies when the cursor is on top of a new row or column because of the automatic scrolling.
static class AutoScroller.ScrollAxis
           
 
Constructor Summary
AutoScroller(Grid<?> grid)
          Creates a new instance for scrolling the given grid.
 
Method Summary
 double getFrozenColumnsWidth()
           
 int getScrollArea()
          Returns the size of the auto scroll area in pixels.
 void setScrollArea(int px)
          Set the auto scroll area height or width depending on the scrolling axis.
 void start(NativeEvent startEvent, AutoScroller.ScrollAxis scrollAxis, AutoScroller.AutoScrollerCallback callback)
          Starts the automatic scrolling detection.
 void stop()
          Stops the automatic scrolling.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(NativeEvent startEvent,
                  AutoScroller.ScrollAxis scrollAxis,
                  AutoScroller.AutoScrollerCallback callback)
Starts the automatic scrolling detection.

Parameters:
startEvent - the event that starts the automatic scroll
scrollAxis - the axis along which the scrolling should happen
callback - 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()


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.