com.google.gwt.widgetideas.client.events
Class AbstractEvent<FiresEvent,HandlerType extends EventHandler>

java.lang.Object
  extended by com.google.gwt.widgetideas.client.events.AbstractEvent<FiresEvent,HandlerType>
Type Parameters:
FiresEvent - source of the event
HandlerType - type of handler expected for this event
Direct Known Subclasses:
ChangeEvent, HighlightEvent, RenderingEvent

public abstract class AbstractEvent<FiresEvent,HandlerType extends EventHandler>
extends java.lang.Object

Abstract event type.


Constructor Summary
protected AbstractEvent(FiresEvent source)
           
 
Method Summary
 void cancelEvent()
          Cancels the current event.
protected abstract  void fire(HandlerType e)
          Delegates firing the event to the given handler type.
 FiresEvent getSource()
          Gets the source of the event.
 boolean isCanceled()
          Is the event canceled?
protected  void tryFire(EventHandler handler)
          Try to fire the given event handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEvent

protected AbstractEvent(FiresEvent source)
Method Detail

cancelEvent

public void cancelEvent()
Cancels the current event.


getSource

public FiresEvent getSource()
Gets the source of the event.


isCanceled

public boolean isCanceled()
Is the event canceled?

Returns:
is the event canceled

fire

protected abstract void fire(HandlerType e)
Delegates firing the event to the given handler type.

Parameters:
e - event

tryFire

protected void tryFire(EventHandler handler)
Try to fire the given event handler.

Throws:
java.lang.ClassCastException - if the wrong event handler is used