public static abstract class

SelectionModel.AbstractSelectionModel

extends Object
implements SelectionModel<T>
java.lang.Object
   ↳ com.google.gwt.view.client.SelectionModel.AbstractSelectionModel<T>
Known Direct Subclasses

Class Overview

A default implementation of SelectionModel that provides listener addition and removal.

Summary

Protected Constructors
SelectionModel.AbstractSelectionModel(ProvidesKey<T> keyProvider)
Construct an AbstractSelectionModel with a given key provider.
Public Methods
HandlerRegistration addSelectionChangeHandler(SelectionChangeEvent.Handler handler)
Adds a SelectionChangeEvent handler.
void fireEvent(GwtEvent<?> event)
Fires the given event to the handlers listening to the event's type.
Object getKey(T item)
Get the key for a list item.
ProvidesKey<T> getKeyProvider()
Returns a ProvidesKey instance that simply returns the input data item.
Protected Methods
void fireSelectionChangeEvent()
boolean isEventCancelled()
Return true if the next scheduled event should be canceled.
boolean isEventScheduled()
Return true if an event is scheduled to be fired.
void scheduleSelectionChangeEvent()
Schedules a SelectionChangeEvent to fire at the end of the current event loop.
void setEventCancelled(boolean isEventCancelled)
Set whether the next scheduled event should be canceled.
void setEventScheduled(boolean isEventScheduled)
Set whether an event is scheduled to be fired.
[Expand]
Inherited Methods
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

Protected Constructors

protected SelectionModel.AbstractSelectionModel (ProvidesKey<T> keyProvider)

Construct an AbstractSelectionModel with a given key provider.

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

Public Methods

public HandlerRegistration addSelectionChangeHandler (SelectionChangeEvent.Handler handler)

Adds a SelectionChangeEvent handler.

Parameters
handler the handler
Returns
  • the registration for the event

public void fireEvent (GwtEvent<?> event)

Fires the given event to the handlers listening to the event's type.

Any exceptions thrown by handlers will be bundled into a UmbrellaException and then re-thrown after all handlers have completed. An exception thrown by a handler will not prevent other handlers from executing.

Parameters
event the event

public Object getKey (T item)

Get the key for a list item.

Parameters
item the list item
Returns
  • the key that represents the item

public ProvidesKey<T> getKeyProvider ()

Returns a ProvidesKey instance that simply returns the input data item.

Returns
  • the key provider, which may be null

Protected Methods

protected void fireSelectionChangeEvent ()

Fire a SelectionChangeEvent. Multiple firings may be coalesced.

protected boolean isEventCancelled ()

Return true if the next scheduled event should be canceled.

Returns
  • true if the event is canceled

protected boolean isEventScheduled ()

Return true if an event is scheduled to be fired.

Returns
  • true if the event is scheduled

protected void scheduleSelectionChangeEvent ()

Schedules a SelectionChangeEvent to fire at the end of the current event loop.

protected void setEventCancelled (boolean isEventCancelled)

Set whether the next scheduled event should be canceled.

Parameters
isEventCancelled if true, cancel the event

protected void setEventScheduled (boolean isEventScheduled)

Set whether an event is scheduled to be fired.

Parameters
isEventScheduled if true, schedule the event