T
- Selection item typepublic interface Selectable<T>
Modifier and Type | Interface and Description |
---|---|
static interface |
Selectable.SelectionEvent<T>
Selection event.
|
static interface |
Selectable.SelectionListener<T>
A listener for listening for selection changes from a
Selectable . |
static class |
Selectable.SelectionMode
Selection modes enumeration.
|
Modifier and Type | Method and Description |
---|---|
com.vaadin.shared.Registration |
addSelectionListener(Selectable.SelectionListener<T> selectionListener)
Adds a
Selectable.SelectionListener to listener to selection changes. |
void |
deselect(T item)
Deselects the given item.
|
void |
deselectAll()
Deselects all currently selected items, if any.
|
Optional<T> |
getFirstSelectedItem()
Get the first selected item.
|
Set<T> |
getSelectedItems()
Get an immutable set of the currently selected items.
|
Selectable.SelectionMode |
getSelectionMode()
Get the selection mode
|
default boolean |
isSelected(T item)
Returns whether the given
item is selected. |
void |
select(T item)
Selects the given item.
|
Selectable.SelectionMode getSelectionMode()
default boolean isSelected(T item)
item
is selected.item
- Item to check (not null)true
if the given item is selected, false
otherwiseSet<T> getSelectedItems()
The iteration order of the items in the returned set is implementation dependent.
Optional<T> getFirstSelectedItem()
void select(T item)
When in Selectable.SelectionMode.SINGLE
, any previously selected item is deselected.
item
- the item to select (not null)void deselect(T item)
item
- the item to deselect (not null)void deselectAll()
com.vaadin.shared.Registration addSelectionListener(Selectable.SelectionListener<T> selectionListener)
Selectable.SelectionListener
to listener to selection changes.selectionListener
- The listener to addRegistration
Copyright © 2019 The Holon Platform. All rights reserved.