com.vaadin.ui
Interface Grid.SelectionModel.Single
- All Superinterfaces:
- ClientConnector, com.vaadin.shared.Connector, Extension, Grid.SelectionModel, java.io.Serializable
- All Known Implementing Classes:
- Grid.SingleSelectionModel
- Enclosing interface:
- Grid.SelectionModel
public static interface Grid.SelectionModel.Single
- extends Grid.SelectionModel
A SelectionModel that supports for only single rows to be selected at
a time.
This interface has a contract of having the same behavior, no matter
how the selection model is interacted with. In other words, if
something is forbidden to do in e.g. the user interface, it must also
be forbidden to do in the server-side and client-side APIs.
|
Method Summary |
java.lang.Object |
getSelectedRow()
Gets the item id of the currently selected item. |
boolean |
isDeselectAllowed()
Sets whether it's allowed to deselect the selected row through
the UI. |
boolean |
select(java.lang.Object itemId)
Marks an item as selected. |
void |
setDeselectAllowed(boolean deselectAllowed)
Sets whether it's allowed to deselect the selected row through
the UI. |
| 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 |
select
boolean select(java.lang.Object itemId)
throws java.lang.IllegalStateException,
java.lang.IllegalArgumentException
- Marks an item as selected.
- Parameters:
itemId - the itemId to mark as selected; null for
deselect
- Returns:
true if the selection state changed.
false if the itemId already was selected
- Throws:
java.lang.IllegalStateException - if the selection was illegal. One such reason might
be that the given id was null, indicating a deselect,
but implementation doesn't allow deselecting.
re-selecting something
java.lang.IllegalArgumentException - if given itemId does not exist in the container of
Grid
getSelectedRow
java.lang.Object getSelectedRow()
- Gets the item id of the currently selected item.
- Returns:
- the item id of the currently selected item, or
null if nothing is selected
setDeselectAllowed
void setDeselectAllowed(boolean deselectAllowed)
- Sets whether it's allowed to deselect the selected row through
the UI. Deselection is allowed by default.
- Parameters:
deselectAllowed - true if the selected row can be
deselected without selecting another row instead;
otherwise false.
isDeselectAllowed
boolean isDeselectAllowed()
- Sets whether it's allowed to deselect the selected row through
the UI.
- Returns:
true if deselection is allowed; otherwise
false
Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.