org.eclipse.birt.report.model.api.core
Interface Listener


public interface Listener

Receives events about a Design Element. Any one listener can listen to any number of design elements. A listener follows the adapter pattern: it adapts a "client" object (usually a UI object) to receive notifications from the "focus" object (the one from which to receive events.)

The typical life cycle is:

  1. Create the listener.
  2. Register interest in one or more focus design elements.
  3. Receive events on those objects. Use the information in the notification event to decide what action to take, if any.
  4. When destroying the client object, deregister the listener from each of design element registered above. (This step is vital for to prevent memory leaks and performance degredation from notifying unused listeners.)

The application uses this interface in one of two ways. First, the client object can simply implement the listener interface. Second, it can create a "helper object" that implements the interface.

In either case, the class must override the notify( ) method. Look at the type of the event to find those of interest. Any one client generally cares about a specific subset of events. Then, look at the sender, target or other members to decide what to do with the particular event. Finally, perform the client-specific action.


Method Summary
 void elementChanged(DesignElementHandle focus, NotificationEvent ev)
          Notifies the listener about a Design Engine event.
 

Method Detail

elementChanged

void elementChanged(DesignElementHandle focus,
                    NotificationEvent ev)
Notifies the listener about a Design Engine event.

Parameters:
focus - The design element that has changed.
ev - The notification event that describes the change.


Copyright © 2008 Actuate Corp. All rights reserved.