com.google.gwt.widgetideas.client.events
Class Handlers<HandlerType extends EventHandler>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<HandlerType>
              extended by com.google.gwt.widgetideas.client.events.Handlers<HandlerType>
Type Parameters:
HandlerType - handler type
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<HandlerType>, java.util.Collection<HandlerType>, java.util.List<HandlerType>, java.util.RandomAccess

public class Handlers<HandlerType extends EventHandler>
extends java.util.ArrayList<HandlerType>

Generic handlers collection.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
Handlers()
           
 
Method Summary
static
<T extends EventHandler>
Handlers<T>
add(Handlers<T> collection, T handler)
          Adds a handler to a handler collection.
 boolean fire(AbstractEvent event)
          Fires the given event.
static boolean remove(Handlers collection, EventHandler handler)
          Removes the handler from the collection if present.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

Handlers

public Handlers()
Method Detail

add

public static <T extends EventHandler> Handlers<T> add(Handlers<T> collection,
                                                       T handler)
Adds a handler to a handler collection. Creates the handler collection if necessary.

Type Parameters:
T - the handler type
Parameters:
collection - the handler collection
handler - the handler to be added
Returns:
the handler collection

remove

public static boolean remove(Handlers collection,
                             EventHandler handler)
Removes the handler from the collection if present.

Parameters:
collection - the collection
handler - the handler to be removed

fire

public boolean fire(AbstractEvent event)
Fires the given event. Returns false if the event was canceled.

Parameters:
event - the event
Returns:
whether the event succeeded.