|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.server.AbstractClientConnector
com.vaadin.server.AbstractExtension
com.vaadin.ui.Grid.AbstractGridExtension
com.vaadin.ui.Grid.AbstractSelectionModel
public abstract static class Grid.AbstractSelectionModel
A base class for SelectionModels that contains some of the logic that is reusable.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface com.vaadin.ui.Grid.SelectionModel |
|---|
Grid.SelectionModel.Multi, Grid.SelectionModel.None, Grid.SelectionModel.Single |
| Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector |
|---|
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener |
| Field Summary | |
|---|---|
protected java.util.LinkedHashSet<java.lang.Object> |
selection
|
| Constructor Summary | |
|---|---|
Grid.AbstractSelectionModel()
|
|
| Method Summary | |
|---|---|
protected void |
checkItemIdExists(java.lang.Object itemId)
Sanity check for existence of item id. |
protected void |
checkItemIdsExist(java.util.Collection<?> itemIds)
Sanity check for existence of item ids in given collection. |
void |
destroyData(java.lang.Object itemId)
Informs the DataGenerator that an item id has been dropped and is no longer needed. |
protected void |
fireSelectionEvent(java.util.Collection<java.lang.Object> oldSelection,
java.util.Collection<java.lang.Object> newSelection)
Fires a SelectionEvent to all the SelectionListeners currently added to the Grid in which this
SelectionModel is. |
void |
generateData(java.lang.Object itemId,
Item item,
elemental.json.JsonObject rowData)
Adds data to row object for given item and item id being sent to client. |
protected java.lang.Object |
getItemId(java.lang.String rowKey)
Gets the item id for a row key. |
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 |
setGrid(Grid grid)
Injects the current Grid instance into the SelectionModel. |
| Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension |
|---|
addComponentToGrid, extend, getColumn, getParentGrid, refreshRow, remove, removeComponentFromGrid |
| Methods inherited from class com.vaadin.server.AbstractExtension |
|---|
getParent, getSupportedParentType, setParent |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.vaadin.ui.Grid.SelectionModel |
|---|
reset |
| 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 |
| Field Detail |
|---|
protected final java.util.LinkedHashSet<java.lang.Object> selection
| Constructor Detail |
|---|
public Grid.AbstractSelectionModel()
| Method Detail |
|---|
public boolean isSelected(java.lang.Object itemId)
Grid.SelectionModel
isSelected in interface Grid.SelectionModelitemId - the item id to check for
true iff the item is selectedpublic java.util.Collection<java.lang.Object> getSelectedRows()
Grid.SelectionModel
getSelectedRows in interface Grid.SelectionModelpublic void setGrid(Grid grid)
Grid.SelectionModelGrid instance into the SelectionModel.
This method should usually call the extend method of
AbstractExtension.
Note: This method should not be called manually.
setGrid in interface Grid.SelectionModelgrid - the Grid in which the SelectionModel currently is, or
null when a selection model is being detached
from a Grid.
protected void checkItemIdExists(java.lang.Object itemId)
throws java.lang.IllegalArgumentException
itemId - item id to be selected / deselected
java.lang.IllegalArgumentException - if item Id doesn't exist in the container of Grid
protected void checkItemIdsExist(java.util.Collection<?> itemIds)
throws java.lang.IllegalArgumentException
itemIds - item id collection to be selected / deselected
java.lang.IllegalArgumentException - if at least one item id doesn't exist in the container of
Grid
protected void fireSelectionEvent(java.util.Collection<java.lang.Object> oldSelection,
java.util.Collection<java.lang.Object> newSelection)
SelectionEvent to all the SelectionListeners currently added to the Grid in which this
SelectionModel is.
Note that this is only a helper method, and routes the call all the
way to Grid. A Grid.SelectionModel is not a
SelectionEvent.SelectionNotifier
oldSelection - the complete Collection of the itemIds that were
selected before this event happenednewSelection - the complete Collection of the itemIds that are
selected after this event happened
public void generateData(java.lang.Object itemId,
Item item,
elemental.json.JsonObject rowData)
DataGenerator
generateData in interface DataGeneratoritemId - item id of itemitem - item being sent to clientrowData - row object being sent to clientpublic void destroyData(java.lang.Object itemId)
DataGenerator
destroyData in interface DataGeneratoritemId - removed item idprotected java.lang.Object getItemId(java.lang.String rowKey)
Grid.AbstractGridExtensionA key is used to identify a particular row on both a server and a client. This method can be used to get the item id for the row key that the client has sent.
getItemId in class Grid.AbstractGridExtensionrowKey - the row key for which to retrieve an item id
key
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||