Listener
object and registers it. When the event occurs, the listener's actionPerformed
method is called. actionPerformed
method is called. An actionPerformed
method must or your PE will surely wedge.
@see aleph.Event
@see aleph.PE
@author Maurice Herlihy
@date July 1998
Button btn = new Button(); btn.addListener(Events.Select, new Listener<ButtonEvent>() { public void handleEvent(ButtonEvent be) { Button button = be.button; } });@param < E> the base event type
This is the core abstraction for receiving messages. The client side of a transport implementation (called an "Adaptor") needs to be wired to a MessageTransportListener
Listener
provide a simple handleEvent()
method that is used internally by SWT to dispatch events. After creating an instance of a class that implements this interface it can be added to a widget using the addListener(int eventType, Listener handler)
method and removed using the removeListener (int eventType, Listener handler)
method. When the specified event occurs, handleEvent(...)
will be sent to the instance.
Classes which implement this interface are described within SWT as providing the untyped listener API. Typically, widgets will also provide a higher-level typed listener API, that is based on the standard java.util.EventListener
pattern.
Note that, since all internal SWT event dispatching is based on untyped listeners, it is simple to build subsets of SWT for use on memory constrained, small footprint devices, by removing the classes and methods which implement the typed listener API.
@see Widget#addListener @see java.util.EventListener @see org.eclipse.swt.eventsInterface for passive listeners on a map. These listeners receive notifications of mouse events on the map, but cannot interfere. That is why they receive a replacement event ( {@link ListenerEvent}) instead of the real mouse events.
The difference with a GraphicsController
is that controllers can do whatever they want, while a listener is not allowed to interfere with the mouse events in any way. As a result, only one GraphicsController
can be active on a map at any given time, while there is no limit to the amount of listeners active on a map.
MessageConsumer
example.
@author Tim Anderson
@version $Revision: 1.2 $ $Date: 2005/11/18 03:28:00 $
MessageConsumer
example.
@author Tim Anderson
@version $Revision: 1.2 $ $Date: 2005/11/18 03:28:00 $
MessageConsumer
example.
@author Tim Anderson
@version $Revision: 1.2 $ $Date: 2005/11/18 03:28:00 $
MessageConsumer
example.
@author Tim Anderson
@version $Revision: 1.2 $ $Date: 2005/11/18 03:28:00 $
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|