Package com.google.gwt.view.client
Interface SelectionModel<T>
-
- Type Parameters:
T- the data type of records in the list
- All Superinterfaces:
HasHandlers,ProvidesKey<T>,SelectionChangeEvent.HasSelectionChangedHandlers
- All Known Subinterfaces:
SetSelectionModel<T>
- All Known Implementing Classes:
DefaultSelectionModel,MultiSelectionModel,NoSelectionModel,OrderedMultiSelectionModel,SelectionModel.AbstractSelectionModel,SingleSelectionModel
public interface SelectionModel<T> extends SelectionChangeEvent.HasSelectionChangedHandlers, ProvidesKey<T>
A model for selection within a list.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSelectionModel.AbstractSelectionModel<T>A default implementation ofSelectionModelthat provides listener addition and removal.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HandlerRegistrationaddSelectionChangeHandler(SelectionChangeEvent.Handler handler)Adds aSelectionChangeEventhandler.booleanisSelected(T object)Check if an object is selected.voidsetSelected(T object, boolean selected)Set the selected state of an object and fire aSelectionChangeEventif the selection has changed.-
Methods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Methods inherited from interface com.google.gwt.view.client.ProvidesKey
getKey
-
-
-
-
Method Detail
-
addSelectionChangeHandler
HandlerRegistration addSelectionChangeHandler(SelectionChangeEvent.Handler handler)
Adds aSelectionChangeEventhandler.- Specified by:
addSelectionChangeHandlerin interfaceSelectionChangeEvent.HasSelectionChangedHandlers- Parameters:
handler- the handler- Returns:
- the registration for the event
-
isSelected
boolean isSelected(T object)
Check if an object is selected.- Parameters:
object- the object- Returns:
- true if selected, false if not
-
setSelected
void setSelected(T object, boolean selected)
Set the selected state of an object and fire aSelectionChangeEventif the selection has changed. Subclasses should not fire an event in the case where selected is true and the object was already selected, or selected is false and the object was not previously selected.- Parameters:
object- the object to select or deselectselected- true to select, false to deselect
-
-