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 gridAll 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:
-
-
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 Modifier and Type Method Description Registration
addSelectionListener(SelectionListener<T> listener)
Adds a generic listener to this selection model, accepting both single and multiselection events.
void
deselect(T item)
Deselects the given item.
void
deselectAll()
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.
boolean
isUserSelectionAllowed()
Checks if the user is allowed to change the selection.
void
select(T item)
Selects the given item.
void
setUserSelectionAllowed(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:
SelectionModel
Returns an immutable set of the currently selected items. It is safe to invoke other
SelectionModel
methods 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:
getSelectedItems
in interfaceSelectionModel<T>
Returns:
the items in the current selection, not null
-
getFirstSelectedItem
public Optional<T> getFirstSelectedItem()
Description copied from interface:
SelectionModel
Get 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:
getFirstSelectedItem
in interfaceSelectionModel<T>
Returns:
the first selected item.
-
select
public void select(T item)
Description copied from interface:
SelectionModel
Selects the given item. Depending on the implementation, may cause other items to be deselected. If the item is already selected, does nothing.
Specified by:
select
in interfaceSelectionModel<T>
Parameters:
item
- the item to select, not null
-
deselect
public void deselect(T item)
Description copied from interface:
SelectionModel
Deselects the given item. If the item is not currently selected, does nothing.
Specified by:
deselect
in interfaceSelectionModel<T>
Parameters:
item
- the item to deselect, not null
-
deselectAll
public void deselectAll()
Description copied from interface:
SelectionModel
Deselects all currently selected items, if any.
Specified by:
deselectAll
in interfaceSelectionModel<T>
-
addSelectionListener
public Registration addSelectionListener(SelectionListener<T> listener)
Description copied from interface:
SelectionModel
Adds a generic listener to this selection model, accepting both single and multiselection events.
Specified by:
addSelectionListener
in interfaceSelectionModel<T>
Parameters:
listener
- the listener to addReturns:
a registration handle for removing the listener
-
setUserSelectionAllowed
public void setUserSelectionAllowed(boolean allowed)
Description copied from interface:
GridSelectionModel
Sets 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:
setUserSelectionAllowed
in interfaceGridSelectionModel<T>
Parameters:
allowed
-true
if the user is allowed to change the selection,false
otherwise
-
isUserSelectionAllowed
public boolean isUserSelectionAllowed()
Description copied from interface:
GridSelectionModel
Checks 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:
isUserSelectionAllowed
in interfaceGridSelectionModel<T>
Returns:
true
if the user is allowed to change the selection,false
otherwise
-
-