com.vaadin.ui.components.grid.selection
Interface SelectionModel.Single

All Superinterfaces:
SelectionModel, java.io.Serializable
All Known Implementing Classes:
SingleSelectionModel
Enclosing interface:
SelectionModel

public static interface SelectionModel.Single
extends SelectionModel

A SelectionModel that supports for only single rows to be selected at a time.

This interface has a contract of having the same behavior, no matter how the selection model is interacted with. In other words, if something is forbidden to do in e.g. the user interface, it must also be forbidden to do in the server-side and client-side APIs.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.vaadin.ui.components.grid.selection.SelectionModel
SelectionModel.Multi, SelectionModel.None, SelectionModel.Single
 
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.
 boolean select(java.lang.Object itemId)
          Marks an item as selected.
 
Methods inherited from interface com.vaadin.ui.components.grid.selection.SelectionModel
getSelectedRows, isSelected, reset, setGrid
 

Method Detail

select

boolean select(java.lang.Object itemId)
               throws java.lang.IllegalStateException
Marks an item as selected.

Parameters:
itemIds - the itemId to mark as selected
Returns:
true if the selection state changed. false if the itemId already was selected
Throws:
java.lang.IllegalStateException - if the selection was illegal. One such reason might be that the implementation already had an item selected, and that needs to be explicitly deselected before re-selecting something
See Also:
deselect(Object)

deselect

boolean deselect(java.lang.Object itemId)
                 throws java.lang.IllegalStateException
Marks an item as deselected.

Parameters:
itemId - the itemId to remove from being selected
Returns:
true if the selection state changed. false if the itemId already was selected
Throws:
java.lang.IllegalStateException - if the deselection was illegal. One such reason might be that the implementation enforces that an item is always selected
See Also:
select(Object)

getSelectedRow

java.lang.Object getSelectedRow()
Gets the item id of the currently selected item.

Returns:
the item id of the currently selected item, or null if nothing is selected


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