com.vaadin.ui
Class Grid.SingleSelectionModel

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.server.AbstractExtension
          extended by com.vaadin.ui.Grid.AbstractGridExtension
              extended by com.vaadin.ui.Grid.AbstractSelectionModel
                  extended by com.vaadin.ui.Grid.SingleSelectionModel
All Implemented Interfaces:
MethodEventSource, ClientConnector, DataGenerator, Extension, com.vaadin.shared.Connector, Grid.SelectionModel, Grid.SelectionModel.Single, java.io.Serializable
Enclosing class:
Grid

public static class Grid.SingleSelectionModel
extends Grid.AbstractSelectionModel
implements Grid.SelectionModel.Single

A default implementation of a Grid.SelectionModel.Single

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Grid.SelectionModel
Grid.SelectionModel.Multi, Grid.SelectionModel.None, Grid.SelectionModel.Single
 
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
 
Field Summary
 
Fields inherited from class com.vaadin.ui.Grid.AbstractSelectionModel
selection
 
Constructor Summary
Grid.SingleSelectionModel()
           
 
Method Summary
protected  void extend(AbstractClientConnector target)
          Add this extension to the target connector.
 java.lang.Object getSelectedRow()
          Gets the item id of the currently selected item.
protected  com.vaadin.shared.ui.grid.selection.SingleSelectionModelState getState()
          Returns the shared state for this connector.
 boolean isDeselectAllowed()
          Sets whether it's allowed to deselect the selected row through the UI.
 void reset()
          Resets the selection state.
 boolean select(java.lang.Object itemId)
          Marks an item as selected.
protected  boolean select(java.lang.Object itemId, boolean refresh)
           
 void setDeselectAllowed(boolean deselectAllowed)
          Sets whether it's allowed to deselect the selected row through the UI.
 
Methods inherited from class com.vaadin.ui.Grid.AbstractSelectionModel
checkItemIdExists, checkItemIdsExist, destroyData, fireSelectionEvent, generateData, getItemId, getSelectedRows, isSelected, setGrid
 
Methods inherited from class com.vaadin.ui.Grid.AbstractGridExtension
addComponentToGrid, getColumn, getParentGrid, refreshRow, remove, removeComponentFromGrid
 
Methods inherited from class com.vaadin.server.AbstractExtension
getParent, getSupportedParentType, setParent
 
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, attach, beforeClientResponse, createState, detach, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getState, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isConnectorEnabled, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Grid.SelectionModel
getSelectedRows, isSelected, setGrid
 
Methods inherited from interface com.vaadin.server.Extension
remove, setParent
 
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
 

Constructor Detail

Grid.SingleSelectionModel

public Grid.SingleSelectionModel()
Method Detail

extend

protected void extend(AbstractClientConnector target)
Description copied from class: AbstractExtension
Add this extension to the target connector. This method is protected to allow subclasses to require a more specific type of target.

Overrides:
extend in class Grid.AbstractGridExtension
Parameters:
target - the connector to attach this extension to

select

public boolean select(java.lang.Object itemId)
Description copied from interface: Grid.SelectionModel.Single
Marks an item as selected.

Specified by:
select in interface Grid.SelectionModel.Single
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

select

protected boolean select(java.lang.Object itemId,
                         boolean refresh)

getSelectedRow

public java.lang.Object getSelectedRow()
Description copied from interface: Grid.SelectionModel.Single
Gets the item id of the currently selected item.

Specified by:
getSelectedRow in interface Grid.SelectionModel.Single
Returns:
the item id of the currently selected item, or null if nothing is selected

reset

public void reset()
Resets the selection state.

If an item is selected, it will become deselected.

Specified by:
reset in interface Grid.SelectionModel

setDeselectAllowed

public void setDeselectAllowed(boolean deselectAllowed)
Description copied from interface: Grid.SelectionModel.Single
Sets whether it's allowed to deselect the selected row through the UI. Deselection is allowed by default.

Specified by:
setDeselectAllowed in interface Grid.SelectionModel.Single
Parameters:
deselectAllowed - true if the selected row can be deselected without selecting another row instead; otherwise false.

isDeselectAllowed

public boolean isDeselectAllowed()
Description copied from interface: Grid.SelectionModel.Single
Sets whether it's allowed to deselect the selected row through the UI.

Specified by:
isDeselectAllowed in interface Grid.SelectionModel.Single
Returns:
true if deselection is allowed; otherwise false

getState

protected com.vaadin.shared.ui.grid.selection.SingleSelectionModelState getState()
Description copied from class: AbstractClientConnector
Returns the shared state for this connector. The shared state object is shared between the server connector and the client connector. Changes are only communicated from the server to the client and not in the other direction.

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.

Overrides:
getState in class AbstractClientConnector
Returns:
The shared state for this connector. Never null.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.