T
- Bean type of the Gridpublic class GridScrollExtension<T>
extends com.vaadin.server.AbstractExtension
Modifier and Type | Class and Description |
---|---|
static interface |
GridScrollExtension.GridColumnsResizedListener<T>
A Listener interface for
GridColumnsResizedEvent |
static interface |
GridScrollExtension.GridRenderedListener<T>
A Listener interface for
GridRenderedEvent |
static interface |
GridScrollExtension.GridResizedListener<T>
A Listener interface for
GridResizedEvent |
static interface |
GridScrollExtension.GridScrolledListener<T>
A listener interface for
GridScrolledEvent |
com.vaadin.server.ClientConnector.AttachEvent, com.vaadin.server.ClientConnector.AttachListener, com.vaadin.server.ClientConnector.ConnectorErrorEvent, com.vaadin.server.ClientConnector.DetachEvent, com.vaadin.server.ClientConnector.DetachListener
Constructor and Description |
---|
GridScrollExtension(com.vaadin.ui.Grid<T> grid)
Constructor method for the extension
|
Modifier and Type | Method and Description |
---|---|
com.vaadin.shared.Registration |
addGridColumnsResizedListener(GridScrollExtension.GridColumnsResizedListener<T> listener)
Add a new
GridScrollExtension.GridColumnsResizedListener
The GridColumnsResizedEvent event is fired every time Grid column sizes has been changed
Note, there is similar event in Grid, but that is fired before you can fetch real column widths, this
event is fired after widths are available, hence you can get correct widths |
com.vaadin.shared.Registration |
addGridRenderedListener(GridScrollExtension.GridRenderedListener<T> listener)
Add a new GridRenderedListener
The GridRenderedEvent event is fired once after Grid's initial column width calculation is complete
|
com.vaadin.shared.Registration |
addGridResizedListener(GridScrollExtension.GridResizedListener<T> listener)
Add a new
GridScrollExtension.GridResizedListener
The GridResizedEvent event is fired every time Grid size has been changed
when setColumnResizeCompensationMode(org.vaadin.extension.gridscroll.shared.ColumnResizeCompensationMode)
with ColumnResizeCompensationMode.RESIZE_GRID has been applied. |
com.vaadin.shared.Registration |
addGridScrolledListener(GridScrollExtension.GridScrolledListener<T> listener)
Add a new
GridScrollExtension.GridScrolledListener
The GridScrolledEvent event is fired when Grid scroll position changes |
void |
adjustGridWidth()
Recalculate the Grid's width and adjust it to according to actual column widths
Programmatic change of column widths do not trigger column resize event, hence you
need to call this if you want to refit Grid
|
void |
adjustLastColumnWidth()
Adjust last the width of the last column to occupy remaining space (if such exist)
Programmatic change of column widths do not trigger column resize event, hence you
need to call this if you want to refit Grid
|
ColumnResizeCompensationMode |
getColumnResizeCompensationMode()
Get the current compensation mode
|
ColumnResizeCompensationMode |
getColumnResizeComponesationMode()
Deprecated.
since 2.3.4, please use
getColumnResizeCompensationMode() instead. |
double |
getColumnWidth(com.vaadin.ui.Grid.Column<?,?> column)
Get actual width of the column by column reference
Note: There is small delay after Grid has been attached before real widths are available
|
double |
getColumnWidth(int i)
Get actual width of the column by index
Note: There is small delay after Grid has been attached before real widths are available
|
double |
getColumnWidth(String columnId)
Get actual width of the column by columnId
Note: There is small delay after Grid has been attached before real widths are available
|
int |
getHeight()
Get actual height
|
int |
getLastXPosition()
Get X scroll position of the Grid
|
int |
getLastYPosition()
Get Y scroll position of the Grid
|
GridScrollExtensionState |
getState() |
int |
getWidth()
Get actual width
|
void |
restoreScrollPosition()
Make Grid to scroll to the last known scroll position
|
void |
setAutoResizeWidth(boolean autoResizeWidth)
Deprecated.
since 2.3.0, use
setColumnResizeCompensationMode(ColumnResizeCompensationMode) instead. |
void |
setColumnResizeCompensationMode(ColumnResizeCompensationMode mode)
Set how Grid should be adjusted when columns are being resized by user
ColumnResizeCompensationMode.RESIZE_GRID will adjust Grid width
and ColumnResizeCompensationMode.RESIZE_COLUMN the last column.
|
void |
setColumnResizeComponesationMode(ColumnResizeCompensationMode mode)
Deprecated.
since 2.3.4, please use
setColumnResizeCompensationMode(ColumnResizeCompensationMode) instead. |
void |
setRestorePosition(boolean restorePosition)
By default extension restores the last known position in order to make Grid recover
position during
TabSheet.Tab changes. |
void |
setScrollPosition(int Xposition,
int Yposition)
Set new scroll position in pixels and scroll grid to that position
|
extend, getParent, getSupportedParentType, remove, setParent
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
public GridScrollExtension(com.vaadin.ui.Grid<T> grid)
grid
- Grid to be extendedpublic com.vaadin.shared.Registration addGridRenderedListener(GridScrollExtension.GridRenderedListener<T> listener)
listener
- A GridRenderedListener to be addedpublic com.vaadin.shared.Registration addGridResizedListener(GridScrollExtension.GridResizedListener<T> listener)
GridScrollExtension.GridResizedListener
The GridResizedEvent
event is fired every time Grid size has been changed
when setColumnResizeCompensationMode(org.vaadin.extension.gridscroll.shared.ColumnResizeCompensationMode)
with ColumnResizeCompensationMode.RESIZE_GRID
has been applied.listener
- A GridResizedListener to be addedpublic com.vaadin.shared.Registration addGridColumnsResizedListener(GridScrollExtension.GridColumnsResizedListener<T> listener)
GridScrollExtension.GridColumnsResizedListener
The GridColumnsResizedEvent
event is fired every time Grid column sizes has been changed
Note, there is similar event in Grid, but that is fired before you can fetch real column widths, this
event is fired after widths are available, hence you can get correct widthslistener
- A GridColumnsResizedListener to be addedpublic com.vaadin.shared.Registration addGridScrolledListener(GridScrollExtension.GridScrolledListener<T> listener)
GridScrollExtension.GridScrolledListener
The GridScrolledEvent
event is fired when Grid scroll position changeslistener
- A GridScrolledListener to be addedpublic void adjustGridWidth()
public void adjustLastColumnWidth()
public double getColumnWidth(com.vaadin.ui.Grid.Column<?,?> column)
column
- The column referencepublic double getColumnWidth(String columnId)
columnId
- Id string / property name of the columnpublic double getColumnWidth(int i)
i
- Index of the columnpublic void restoreScrollPosition()
public int getLastXPosition()
public int getLastYPosition()
public int getWidth()
public int getHeight()
public void setScrollPosition(int Xposition, int Yposition)
Xposition
- The new y scroll positionYposition
- The new y scroll position@Deprecated public void setAutoResizeWidth(boolean autoResizeWidth)
setColumnResizeCompensationMode(ColumnResizeCompensationMode)
instead.autoResizeWidth
- If true Grid resizes itself to column widths@Deprecated public void setColumnResizeComponesationMode(ColumnResizeCompensationMode mode)
setColumnResizeCompensationMode(ColumnResizeCompensationMode)
instead.public void setColumnResizeCompensationMode(ColumnResizeCompensationMode mode)
Grid.Column.setMaximumWidth(double)
cannot be used with the last columnmode
- ColumnResizeCompensationMode@Deprecated public ColumnResizeCompensationMode getColumnResizeComponesationMode()
getColumnResizeCompensationMode()
instead.public ColumnResizeCompensationMode getColumnResizeCompensationMode()
public GridScrollExtensionState getState()
getState
in class com.vaadin.server.AbstractClientConnector
public void setRestorePosition(boolean restorePosition)
TabSheet.Tab
changes. There is a side effect
of this, that Grid.scrollTo(int)
does not work when calling right after Grid
has been created. This feature can be turned off if needed by setting this to false.restorePosition
- Use false to disable automatic position restore featureCopyright © 2020 Magnolia International Ltd.. All rights reserved.