|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.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 |
| Field Summary | |
|---|---|
protected Grid |
grid
|
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. |
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. |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.vaadin.ui.Grid.SelectionModel |
|---|
reset |
| Field Detail |
|---|
protected final java.util.LinkedHashSet<java.lang.Object> selection
protected Grid grid
| 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.
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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||