T
- the type of the items to selectC
- the component typepublic static interface SelectionModel.Single<C extends Component,T> extends SelectionModel<C,T>
SelectionModel.Multi<C extends Component,T>, SelectionModel.Single<C extends Component,T>
Modifier and Type | Method and Description |
---|---|
default void |
deselectAll()
Deselects all currently selected items, if any.
|
default Optional<T> |
getFirstSelectedItem()
Get first selected data item.
|
Optional<T> |
getSelectedItem()
Returns the currently selected item, or an empty optional if no item
is selected.
|
default Set<T> |
getSelectedItems()
Returns a singleton set of the currently selected item or an empty
set if no item is selected.
|
boolean |
isDeselectAllowed()
Gets whether it's allowed to deselect the selected row through the
UI.
|
void |
select(T item)
Selects the given item.
|
void |
setDeselectAllowed(boolean deselectAllowed)
Sets whether it's allowed to deselect the selected row through the
UI.
|
default void |
setSelectedItem(T item)
Sets the current selection to the given item, or clears selection if
given
null . |
addSelectionListener, deselect, isSelected
void select(T item)
select
in interface SelectionModel<C extends Component,T>
item
- the item to selectOptional<T> getSelectedItem()
default void setSelectedItem(T item)
null
.item
- the item to select or null
to clear selectiondefault void deselectAll()
SelectionModel
deselectAll
in interface SelectionModel<C extends Component,T>
default Set<T> getSelectedItems()
getSelectedItems
in interface SelectionModel<C extends Component,T>
getSelectedItem()
default Optional<T> getFirstSelectedItem()
SelectionModel
This is the same as getSelectedItem()
in case of single
selection and the first selected item from
SelectionModel.getSelectedItems()
in case of multiselection.
getFirstSelectedItem
in interface SelectionModel<C extends Component,T>
void setDeselectAllowed(boolean deselectAllowed)
deselectAllowed
- true
if the selected row can be deselected
without selecting another row instead; otherwise
false
.boolean isDeselectAllowed()
true
if deselection is allowed; otherwise
false
Copyright © 2025. All rights reserved.