Class AbstractSelectionModelConnector
- java.lang.Object
-
- com.vaadin.client.ui.AbstractConnector
-
- com.vaadin.client.extensions.AbstractExtensionConnector
-
- com.vaadin.client.connectors.grid.AbstractSelectionModelConnector
-
- All Implemented Interfaces:
com.google.gwt.event.shared.EventHandler,StateChangeEvent.StateChangeHandler,ServerConnector,Connector,Serializable
- Direct Known Subclasses:
MultiSelectionModelConnector,SingleSelectionModelConnector
public abstract class AbstractSelectionModelConnector extends AbstractExtensionConnector
Abstract base class for grid's selection models.- Since:
- 8.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractSelectionModelConnector()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidextend(ServerConnector target)Called when the extension is attached to its parent.protected Grid<elemental.json.JsonObject>getGrid()Shorthand for fetching the grid this selection model is bound to.GridConnectorgetParent()Returns the parent of this connector.protected SpaceSelectHandler<elemental.json.JsonObject>getSpaceSelectionHandler()Gets space selection handler registered for the Grid.AbstractSelectionModelStategetState()Returns the shared state object for this connector.protected abstract voidinitSelectionModel()Initializes the selection model and sets it to the grid.protected booleanisSelected(elemental.json.JsonObject item)Returns whether the given item selected in grid or not.voidonUnregister()Event called when connector has been unregistered.-
Methods inherited from class com.vaadin.client.extensions.AbstractExtensionConnector
setParent
-
Methods inherited from class com.vaadin.client.ui.AbstractConnector
addStateChangeHandler, addStateChangeHandler, createState, doInit, ensureHandlerManager, fireEvent, forceStateChange, getChildren, getConnection, getConnectorId, getResourceUrl, getRpcImplementations, getRpcProxy, getStateType, getTag, hasEventListener, init, isEnabled, onStateChanged, registerRpc, removeStateChangeHandler, removeStateChangeHandler, setChildren, setTag, unregisterRpc, updateEnabledState
-
-
-
-
Method Detail
-
extend
protected void extend(ServerConnector target)
Description copied from class:AbstractExtensionConnectorCalled when the extension is attached to its parent. This method is only called once as an extension cannot be moved from one parent to another.- Specified by:
extendin classAbstractExtensionConnector- Parameters:
target- The connector this extension extends
-
onUnregister
public void onUnregister()
Description copied from interface:ServerConnectorEvent called when connector has been unregistered.- Specified by:
onUnregisterin interfaceServerConnector- Overrides:
onUnregisterin classAbstractConnector
-
initSelectionModel
protected abstract void initSelectionModel()
Initializes the selection model and sets it to the grid.This method is only invoked once by
extend(ServerConnector)inAbstractSelectionModelConnectorwhen the grid is available viagetGrid()and the selection model should be taken into use.
-
getParent
public GridConnector getParent()
Description copied from interface:ServerConnectorReturns the parent of this connector. Can be null for only the root connector.- Specified by:
getParentin interfaceConnector- Specified by:
getParentin interfaceServerConnector- Overrides:
getParentin classAbstractConnector- Returns:
- The parent of this connector, as set by
ServerConnector.setParent(ServerConnector).
-
getGrid
protected Grid<elemental.json.JsonObject> getGrid()
Shorthand for fetching the grid this selection model is bound to.- Returns:
- the grid
-
getSpaceSelectionHandler
protected SpaceSelectHandler<elemental.json.JsonObject> getSpaceSelectionHandler()
Gets space selection handler registered for the Grid.- Returns:
- space selection handler
-
getState
public AbstractSelectionModelState getState()
Description copied from class:AbstractConnectorReturns the shared state object for this connector. Override this method to define the shared state type for your connector.- Specified by:
getStatein interfaceServerConnector- Overrides:
getStatein classAbstractConnector- Returns:
- the current shared state (never null)
-
isSelected
protected boolean isSelected(elemental.json.JsonObject item)
Returns whether the given item selected in grid or not.- Parameters:
item- the item to check- Returns:
trueif selectedfalseif not
-
-