com.vaadin.ui
Class Grid.SingleSelectionModel

java.lang.Object
  extended by com.vaadin.ui.Grid.AbstractSelectionModel
      extended by com.vaadin.ui.Grid.SingleSelectionModel
All Implemented Interfaces:
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
 
Field Summary
 
Fields inherited from class com.vaadin.ui.Grid.AbstractSelectionModel
grid, selection
 
Constructor Summary
Grid.SingleSelectionModel()
           
 
Method Summary
 java.lang.Object getSelectedRow()
          Gets the item id of the currently selected item.
 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.
 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, fireSelectionEvent, getSelectedRows, isSelected, setGrid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.vaadin.ui.Grid.SelectionModel
getSelectedRows, isSelected, setGrid
 

Constructor Detail

Grid.SingleSelectionModel

public Grid.SingleSelectionModel()
Method Detail

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

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


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