com.vaadin.ui.components.grid.selection
Class SingleSelectionModel

java.lang.Object
  extended by com.vaadin.ui.components.grid.selection.AbstractSelectionModel
      extended by com.vaadin.ui.components.grid.selection.SingleSelectionModel
All Implemented Interfaces:
SelectionModel, SelectionModel.Single, java.io.Serializable

public class SingleSelectionModel
extends AbstractSelectionModel
implements SelectionModel.Single

A default implementation of a SelectionModel.Single

Since:
7.4
Author:
Vaadin Ltd
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.ui.components.grid.selection.SelectionModel
SelectionModel.Multi, SelectionModel.None, SelectionModel.Single
 
Field Summary
 
Fields inherited from class com.vaadin.ui.components.grid.selection.AbstractSelectionModel
grid, selection
 
Constructor Summary
SingleSelectionModel()
           
 
Method Summary
 boolean deselect(java.lang.Object itemId)
          Marks an item as deselected.
 java.lang.Object getSelectedRow()
          Gets the item id of the currently selected item.
 void reset()
          Resets the selection state.
 boolean select(java.lang.Object itemId)
          Marks an item as selected.
 
Methods inherited from class com.vaadin.ui.components.grid.selection.AbstractSelectionModel
fireSelectionChangeEvent, 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.components.grid.selection.SelectionModel
getSelectedRows, isSelected, setGrid
 

Constructor Detail

SingleSelectionModel

public SingleSelectionModel()
Method Detail

select

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

Specified by:
select in interface SelectionModel.Single
Returns:
true if the selection state changed. false if the itemId already was selected
See Also:
SelectionModel.Single.deselect(Object)

deselect

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

Specified by:
deselect in interface SelectionModel.Single
Parameters:
itemId - the itemId to remove from being selected
Returns:
true if the selection state changed. false if the itemId already was selected
See Also:
SelectionModel.Single.select(Object)

getSelectedRow

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

Specified by:
getSelectedRow in interface 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 SelectionModel


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