Package com.vaadin.featurepack.ui
Interface FGrid.SelectionModel.Single
- All Superinterfaces:
FGrid.SelectionModel,Serializable
- All Known Implementing Classes:
FGrid.SingleSelectionModel
- Enclosing interface:
FGrid.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.featurepack.ui.FGrid.SelectionModel
FGrid.SelectionModel.HasUserSelectionAllowed, FGrid.SelectionModel.Multi, FGrid.SelectionModel.None, FGrid.SelectionModel.Single -
Method Summary
Modifier and TypeMethodDescriptionGets the item id of the currently selected item.booleanSets whether it's allowed to deselect the selected row through the UI.booleanMarks an item as selected.voidsetDeselectAllowed(boolean deselectAllowed) Sets whether it's allowed to deselect the selected row through the UI.Methods inherited from interface com.vaadin.featurepack.ui.FGrid.SelectionModel
getSelectedRows, isSelected, reset, setGrid
-
Method Details
-
select
Marks an item as selected.- Parameters:
itemId- the itemId to mark as selected;nullfor deselect- Returns:
trueif the selection state changed.falseif the itemId already was selected- Throws:
IllegalStateException- if the selection was illegal. One such reason might be that the given id was null, indicating a deselect, but implementation doesn't allow deselecting. re-selecting somethingIllegalArgumentException- if given itemId does not exist in the container of Grid
-
getSelectedRow
Object getSelectedRow()Gets the item id of the currently selected item.- Returns:
- the item id of the currently selected item, or
nullif nothing is selected
-
setDeselectAllowed
void setDeselectAllowed(boolean deselectAllowed) Sets whether it's allowed to deselect the selected row through the UI. Deselection is allowed by default.- Parameters:
deselectAllowed-trueif the selected row can be deselected without selecting another row instead; otherwisefalse.
-
isDeselectAllowed
boolean isDeselectAllowed()Sets whether it's allowed to deselect the selected row through the UI.- Returns:
trueif deselection is allowed; otherwisefalse
-