com.vaadin.ui
Interface Grid.SelectionModel

All Superinterfaces:
ClientConnector, com.vaadin.shared.Connector, Extension, java.io.Serializable
All Known Subinterfaces:
Grid.SelectionModel.Multi, Grid.SelectionModel.None, Grid.SelectionModel.Single
All Known Implementing Classes:
Grid.AbstractSelectionModel, Grid.MultiSelectionModel, Grid.NoSelectionModel, Grid.SingleSelectionModel
Enclosing class:
Grid

public static interface Grid.SelectionModel
extends java.io.Serializable, Extension

The server-side interface that controls Grid's selection state. SelectionModel should extend Grid.AbstractGridExtension.


Nested Class Summary
static interface Grid.SelectionModel.Multi
          A SelectionModel that supports multiple selections to be made.
static interface Grid.SelectionModel.None
          A SelectionModel that does not allow for rows to be selected.
static interface Grid.SelectionModel.Single
          A SelectionModel that supports for only single rows to be selected at a time.
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Method Summary
 java.util.Collection<java.lang.Object> getSelectedRows()
          Returns a collection of all the currently selected itemIds.
 boolean isSelected(java.lang.Object itemId)
          Checks whether an item is selected or not.
 void reset()
          Resets the SelectiomModel to an initial state.
 void setGrid(Grid grid)
          Injects the current Grid instance into the SelectionModel.
 
Methods inherited from interface com.vaadin.server.Extension
remove, setParent
 
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getParent, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
 
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
 

Method Detail

isSelected

boolean isSelected(java.lang.Object itemId)
Checks whether an item is selected or not.

Parameters:
itemId - the item id to check for
Returns:
true iff the item is selected

getSelectedRows

java.util.Collection<java.lang.Object> getSelectedRows()
Returns a collection of all the currently selected itemIds.

Returns:
a collection of all the currently selected itemIds

setGrid

void setGrid(Grid grid)
Injects the current Grid instance into the SelectionModel. This method should usually call the extend method of AbstractExtension.

Note: This method should not be called manually.

Parameters:
grid - the Grid in which the SelectionModel currently is, or null when a selection model is being detached from a Grid.

reset

void reset()
Resets the SelectiomModel to an initial state.

Most often this means that the selection state is cleared, but implementations are free to interpret the "initial state" as they wish. Some, for example, may want to keep the first selected item as selected.



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