com.google.gwt.view.client
Interface SelectionModel<T>

Type Parameters:
T - the data type of records in the list
All Superinterfaces:
HasHandlers, ProvidesKey<T>
All Known Implementing Classes:
DefaultSelectionModel, MultiSelectionModel, NoSelectionModel, SelectionModel.AbstractSelectionModel, SingleSelectionModel

public interface SelectionModel<T>
extends HasHandlers, ProvidesKey<T>

A model for selection within a list.

Note: This class is new and its interface subject to change.


Nested Class Summary
static class SelectionModel.AbstractSelectionModel<T>
          A default implementation of SelectionModel that provides listener addition and removal.
static class SelectionModel.SelectionChangeEvent
          Represents a selection change event.
static interface SelectionModel.SelectionChangeHandler
          Handler interface for SelectionModel.SelectionChangeEvent events.
 
Method Summary
 HandlerRegistration addSelectionChangeHandler(SelectionModel.SelectionChangeHandler handler)
          Adds a SelectionModel.SelectionChangeEvent handler.
 boolean isSelected(T object)
          Check if an object is selected.
 void setSelected(T object, boolean selected)
          Set the selected state of an object.
 
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(SelectionModel.SelectionChangeHandler handler)
Adds a SelectionModel.SelectionChangeEvent handler.

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.

Parameters:
object - the object to select or deselect
selected - true to select, false to deselect