Package com.vaadin.featurepack.ui
Class FGrid.SingleSelectionModel
java.lang.Object
com.vaadin.featurepack.ui.FGrid.AbstractSelectionModel
com.vaadin.featurepack.ui.FGrid.SingleSelectionModel
- All Implemented Interfaces:
FGrid.SelectionModel,FGrid.SelectionModel.HasUserSelectionAllowed,FGrid.SelectionModel.Single,Serializable
- Enclosing class:
FGrid
public static class FGrid.SingleSelectionModel
extends FGrid.AbstractSelectionModel
implements FGrid.SelectionModel.Single, FGrid.SelectionModel.HasUserSelectionAllowed
A default implementation of a
FGrid.SelectionModel.Single- See Also:
-
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 -
Field Summary
Fields inherited from class com.vaadin.featurepack.ui.FGrid.AbstractSelectionModel
parentGrid, selection -
Constructor Summary
Constructors -
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.booleanChecks if the user is allowed to change the selection.voidreset()Resets the selection state.booleanMarks an item as selected.protected booleanvoidsetDeselectAllowed(boolean deselectAllowed) Sets whether it's allowed to deselect the selected row through the UI.voidsetUserSelectionAllowed(boolean userSelectionAllowed) Sets whether the user is allowed to change the selection.Methods inherited from class com.vaadin.featurepack.ui.FGrid.AbstractSelectionModel
checkItemIdExists, checkItemIdsExist, fireSelectionEvent, getParentGrid, getSelectedRows, isSelected, setGridMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.featurepack.ui.FGrid.SelectionModel
getSelectedRows, isSelected, setGrid
-
Constructor Details
-
SingleSelectionModel
public SingleSelectionModel()
-
-
Method Details
-
select
Description copied from interface:FGrid.SelectionModel.SingleMarks an item as selected.- Specified by:
selectin interfaceFGrid.SelectionModel.Single- Parameters:
itemId- the itemId to mark as selected;nullfor deselect- Returns:
trueif the selection state changed.falseif the itemId already was selected
-
select
-
getSelectedRow
Description copied from interface:FGrid.SelectionModel.SingleGets the item id of the currently selected item.- Specified by:
getSelectedRowin interfaceFGrid.SelectionModel.Single- Returns:
- the item id of the currently selected item, or
nullif nothing is selected
-
reset
public void reset()Resets the selection state.If an item is selected, it will become deselected.
- Specified by:
resetin interfaceFGrid.SelectionModel
-
setDeselectAllowed
public void setDeselectAllowed(boolean deselectAllowed) Description copied from interface:FGrid.SelectionModel.SingleSets whether it's allowed to deselect the selected row through the UI. Deselection is allowed by default.- Specified by:
setDeselectAllowedin interfaceFGrid.SelectionModel.Single- Parameters:
deselectAllowed-trueif the selected row can be deselected without selecting another row instead; otherwisefalse.
-
isDeselectAllowed
public boolean isDeselectAllowed()Description copied from interface:FGrid.SelectionModel.SingleSets whether it's allowed to deselect the selected row through the UI.- Specified by:
isDeselectAllowedin interfaceFGrid.SelectionModel.Single- Returns:
trueif deselection is allowed; otherwisefalse
-
isUserSelectionAllowed
public boolean isUserSelectionAllowed()Description copied from interface:FGrid.SelectionModel.HasUserSelectionAllowedChecks if the user is allowed to change the selection.- Specified by:
isUserSelectionAllowedin interfaceFGrid.SelectionModel.HasUserSelectionAllowed- Returns:
trueif the user is allowed to change the selection,falseotherwise
-
setUserSelectionAllowed
public void setUserSelectionAllowed(boolean userSelectionAllowed) Description copied from interface:FGrid.SelectionModel.HasUserSelectionAllowedSets whether the user is allowed to change the selection.- Specified by:
setUserSelectionAllowedin interfaceFGrid.SelectionModel.HasUserSelectionAllowed- Parameters:
userSelectionAllowed-trueif the user is allowed to change the selection,falseotherwise
-