Package com.vaadin.ui.components.grid
Class NoSelectionModel<T>
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.server.AbstractExtension
-
- com.vaadin.ui.components.grid.NoSelectionModel<T>
-
- Type Parameters:
T- the type of items in the grid
- All Implemented Interfaces:
SelectionModel<T>,MethodEventSource,ClientConnector,Extension,Connector,GridSelectionModel<T>,Serializable
public class NoSelectionModel<T> extends AbstractExtension implements GridSelectionModel<T>
Selection model that doesn't allow selecting anything from the grid.- Since:
- 8.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.data.SelectionModel
SelectionModel.Multi<T>, SelectionModel.Single<T>
-
-
Constructor Summary
Constructors Constructor Description NoSelectionModel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegistrationaddSelectionListener(SelectionListener<T> listener)Adds a generic listener to this selection model, accepting both single and multiselection events.voiddeselect(T item)Deselects the given item.voiddeselectAll()Deselects all currently selected items, if any.Optional<T>getFirstSelectedItem()Get first selected data item.Set<T>getSelectedItems()Returns an immutable set of the currently selected items.booleanisUserSelectionAllowed()Checks if the user is allowed to change the selection.voidselect(T item)Selects the given item.voidsetUserSelectionAllowed(boolean allowed)Sets whether the user is allowed to change the selection.-
Methods inherited from class com.vaadin.server.AbstractExtension
extend, getParent, getSupportedParentType, remove, setParent
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource, updateDiffstate
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
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
-
Methods inherited from interface com.vaadin.ui.components.grid.GridSelectionModel
remove
-
Methods inherited from interface com.vaadin.data.SelectionModel
isSelected
-
-
-
-
Method Detail
-
getSelectedItems
public Set<T> getSelectedItems()
Description copied from interface:SelectionModelReturns an immutable set of the currently selected items. It is safe to invoke otherSelectionModelmethods while iterating over the set.Implementation note: the iteration order of the items in the returned set should be well-defined and documented by the implementing class.
- Specified by:
getSelectedItemsin interfaceSelectionModel<T>- Returns:
- the items in the current selection, not null
-
getFirstSelectedItem
public Optional<T> getFirstSelectedItem()
Description copied from interface:SelectionModelGet first selected data item.This is the same as
SelectionModel.Single.getSelectedItem()in case of single selection and the first selected item fromSelectionModel.getSelectedItems()in case of multiselection.- Specified by:
getFirstSelectedItemin interfaceSelectionModel<T>- Returns:
- the first selected item.
-
select
public void select(T item)
Description copied from interface:SelectionModelSelects the given item. Depending on the implementation, may cause other items to be deselected. If the item is already selected, does nothing.- Specified by:
selectin interfaceSelectionModel<T>- Parameters:
item- the item to select, not null
-
deselect
public void deselect(T item)
Description copied from interface:SelectionModelDeselects the given item. If the item is not currently selected, does nothing.- Specified by:
deselectin interfaceSelectionModel<T>- Parameters:
item- the item to deselect, not null
-
deselectAll
public void deselectAll()
Description copied from interface:SelectionModelDeselects all currently selected items, if any.- Specified by:
deselectAllin interfaceSelectionModel<T>
-
addSelectionListener
public Registration addSelectionListener(SelectionListener<T> listener)
Description copied from interface:SelectionModelAdds a generic listener to this selection model, accepting both single and multiselection events.- Specified by:
addSelectionListenerin interfaceSelectionModel<T>- Parameters:
listener- the listener to add- Returns:
- a registration handle for removing the listener
-
setUserSelectionAllowed
public void setUserSelectionAllowed(boolean allowed)
Description copied from interface:GridSelectionModelSets whether the user is allowed to change the selection.The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.
- Specified by:
setUserSelectionAllowedin interfaceGridSelectionModel<T>- Parameters:
allowed-trueif the user is allowed to change the selection,falseotherwise
-
isUserSelectionAllowed
public boolean isUserSelectionAllowed()
Description copied from interface:GridSelectionModelChecks if the user is allowed to change the selection.The check is done only for the client side actions. It doesn't affect selection requests sent from the server side.
- Specified by:
isUserSelectionAllowedin interfaceGridSelectionModel<T>- Returns:
trueif the user is allowed to change the selection,falseotherwise
-
-