GWT Tk 0.2.3

asquare.gwt.tk.client.ui.behavior
Class EventDelegateAdaptor

java.lang.Object
  extended by asquare.gwt.tk.client.ui.behavior.EventDelegateAdaptor
All Implemented Interfaces:
EventDelegate
Direct Known Subclasses:
ControllerAdaptor

public abstract class EventDelegateAdaptor
extends Object
implements EventDelegate


Constructor Summary
EventDelegateAdaptor()
          Default constructor for convienence.
EventDelegateAdaptor(int eventBits)
          Creates an event delegate which is interested in the specified bits.
 
Method Summary
protected  boolean doBrowserEvent(Widget widget, Event event)
          A convenience method for processing events.
 int getEventBits()
          Get a bitmask representing events this delegate is interested in processing.
 void onBrowserEvent(Widget widget, Event event)
          Call this from your widget's onBrowserEvent() method to to delegate events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EventDelegateAdaptor

public EventDelegateAdaptor()
Default constructor for convienence. Subclasses must override getEventBits() if they want to process events.


EventDelegateAdaptor

public EventDelegateAdaptor(int eventBits)
Creates an event delegate which is interested in the specified bits.

Parameters:
eventBits - a bitmask of the events to process
See Also:
Event
Method Detail

onBrowserEvent

public void onBrowserEvent(Widget widget,
                           Event event)
Description copied from interface: EventDelegate
Call this from your widget's onBrowserEvent() method to to delegate events.

Example:

 public void onBrowserEvent(Event event)
 {
   super.onBrowserEvent(event);
   delegate.onBrowserEvent(this, event);
 }
 

Specified by:
onBrowserEvent in interface EventDelegate
Parameters:
widget - the wiget that originated the event
event - the event

doBrowserEvent

protected boolean doBrowserEvent(Widget widget,
                                 Event event)
A convenience method for processing events. The event is cancelled if the return value is false.

Returns:
false to cancel the event

getEventBits

public int getEventBits()
Get a bitmask representing events this delegate is interested in processing. Override in subclass if using the default constructor.

Specified by:
getEventBits in interface EventDelegate
Returns:
a bitmask of the events to process
See Also:
Event

GWT Tk 0.2.3

© 2007 Mat Gessel