public static class Grid.SingleSelectionModel extends Grid.AbstractSelectionModel implements Grid.SelectionModel.Single, Grid.SelectionModel.HasUserSelectionAllowed
Grid.SelectionModel.SingleGrid.SelectionModel.HasUserSelectionAllowed, Grid.SelectionModel.Multi, Grid.SelectionModel.None, Grid.SelectionModel.SingleClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListenerselection| Constructor and Description |
|---|
SingleSelectionModel() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
extend(AbstractClientConnector target)
Add this extension to the target connector.
|
Object |
getSelectedRow()
Gets the item id of the currently selected item.
|
protected SingleSelectionModelState |
getState()
Returns the shared state for this connector.
|
protected SingleSelectionModelState |
getState(boolean markAsDirty)
Returns the shared state for this connector.
|
boolean |
isDeselectAllowed()
Sets whether it's allowed to deselect the selected row through
the UI.
|
boolean |
isUserSelectionAllowed()
Checks if the user is allowed to change the selection.
|
void |
reset()
Resets the selection state.
|
boolean |
select(Object itemId)
Marks an item as selected.
|
protected boolean |
select(Object itemId,
boolean refresh) |
void |
setDeselectAllowed(boolean deselectAllowed)
Sets whether it's allowed to deselect the selected row through
the UI.
|
void |
setUserSelectionAllowed(boolean userSelectionAllowed)
Sets whether the user is allowed to change the selection.
|
checkItemIdExists, checkItemIdsExist, destroyData, fireSelectionEvent, generateData, getItemId, getSelectedRows, isSelected, setGridaddComponentToGrid, getColumn, getParentGrid, refreshRow, remove, removeComponentFromGridgetParent, getSupportedParentType, setParentaddAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResourceclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitgetSelectedRows, isSelected, setGridaddAttachListener, addDetachListener, attach, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getParent, getRpcManager, getStateType, getUI, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandlergetConnectorIdprotected void extend(AbstractClientConnector target)
AbstractExtensionextend in class Grid.AbstractGridExtensiontarget - the connector to attach this extension topublic boolean select(Object itemId)
Grid.SelectionModel.Singleselect in interface Grid.SelectionModel.SingleitemId - the itemId to mark as selected; null for
deselecttrue if the selection state changed.
false if the itemId already was selectedprotected boolean select(Object itemId, boolean refresh)
public Object getSelectedRow()
Grid.SelectionModel.SinglegetSelectedRow in interface Grid.SelectionModel.Singlenull if nothing is selectedpublic void reset()
If an item is selected, it will become deselected.
reset in interface Grid.SelectionModelpublic void setDeselectAllowed(boolean deselectAllowed)
Grid.SelectionModel.SinglesetDeselectAllowed in interface Grid.SelectionModel.SingledeselectAllowed - true if the selected row can be
deselected without selecting another row instead;
otherwise false.public boolean isDeselectAllowed()
Grid.SelectionModel.SingleisDeselectAllowed in interface Grid.SelectionModel.Singletrue if deselection is allowed; otherwise
falseprotected SingleSelectionModelState getState()
AbstractClientConnector
As a side effect, marks the connector dirty so any changes done to the
state will be sent to the client. Use getState(false) to avoid
marking the connector as dirty.
getState in class AbstractClientConnectorprotected SingleSelectionModelState getState(boolean markAsDirty)
AbstractClientConnectorgetState in class AbstractClientConnectormarkAsDirty - true if the connector should automatically be marked dirty,
false otherwiseAbstractClientConnector.getState()public boolean isUserSelectionAllowed()
Grid.SelectionModel.HasUserSelectionAllowedisUserSelectionAllowed in interface Grid.SelectionModel.HasUserSelectionAllowedtrue if the user is allowed to change the
selection, false otherwisepublic void setUserSelectionAllowed(boolean userSelectionAllowed)
Grid.SelectionModel.HasUserSelectionAllowedsetUserSelectionAllowed in interface Grid.SelectionModel.HasUserSelectionAlloweduserSelectionAllowed - true if the user is allowed to change the
selection, false otherwiseCopyright © 2023 Vaadin Ltd. All rights reserved.