public abstract class

DefaultSelectionModel

extends SelectionModel.AbstractSelectionModel<T>
java.lang.Object
   ↳ com.google.gwt.view.client.SelectionModel.AbstractSelectionModel<T>
     ↳ com.google.gwt.view.client.DefaultSelectionModel<T>

Class Overview

A convenience SelectionModel that allows records to be selected according to a subclass-defined rule, plus a list of positive or negative exceptions.

Summary

Public Constructors
DefaultSelectionModel()
Constructs a DefaultSelectionModel without a key provider.
DefaultSelectionModel(ProvidesKey<T> keyProvider)
Constructs a DefaultSelectionModel with the given key provider.
Public Methods
void clearExceptions()
Removes all exceptions.
abstract boolean isDefaultSelected(T object)
Returns true if the given object should be selected by default.
boolean isSelected(T object)
If the given object is marked as an exception, return the exception value.
void setSelected(T object, boolean selected)
Sets an object's selection state.
Protected Methods
void fireSelectionChangeEvent()
Map<ObjectBoolean> getExceptions(Map<ObjectBoolean> output)
Copies the exceptions map into a user-supplied map.
[Expand]
Inherited Methods
From class com.google.gwt.view.client.SelectionModel.AbstractSelectionModel
From class java.lang.Object
From interface com.google.gwt.event.shared.HasHandlers
From interface com.google.gwt.view.client.ProvidesKey
From interface com.google.gwt.view.client.SelectionModel

Public Constructors

public DefaultSelectionModel ()

Constructs a DefaultSelectionModel without a key provider.

public DefaultSelectionModel (ProvidesKey<T> keyProvider)

Constructs a DefaultSelectionModel with the given key provider.

Parameters
keyProvider an instance of ProvidesKey, or null if the record object should act as its own key

Public Methods

public void clearExceptions ()

Removes all exceptions.

public abstract boolean isDefaultSelected (T object)

Returns true if the given object should be selected by default. Subclasses implement this method in order to define the default selection behavior.

Parameters
object an object of this SelectionModel's type
Returns
  • true if the object should be selected by default

public boolean isSelected (T object)

If the given object is marked as an exception, return the exception value. Otherwise, return the value of isDefaultSelected for the given object.

public void setSelected (T object, boolean selected)

Sets an object's selection state. If the object is currently marked as an exception, and the new selected state differs from the previous selected state, the object is removed from the list of exceptions. Otherwise, the object is added to the list of exceptions with the given selected state.

Protected Methods

protected void fireSelectionChangeEvent ()

Fire a SelectionChangeEvent. Multiple firings may be coalesced.

protected Map<ObjectBoolean> getExceptions (Map<ObjectBoolean> output)

Copies the exceptions map into a user-supplied map.

Parameters
output the user supplied map
Returns
  • the user supplied map