01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.swt.widgets;
11:
12: /**
13: * Implementers of <code>Listener</code> provide a simple
14: * <code>handleEvent()</code> method that is used internally
15: * by SWT to dispatch events.
16: * <p>
17: * After creating an instance of a class that implements this interface
18: * it can be added to a widget using the
19: * <code>addListener(int eventType, Listener handler)</code> method and
20: * removed using the
21: * <code>removeListener (int eventType, Listener handler)</code> method.
22: * When the specified event occurs, <code>handleEvent(...)</code> will
23: * be sent to the instance.
24: * </p>
25: * <p>
26: * Classes which implement this interface are described within SWT as
27: * providing the <em>untyped listener</em> API. Typically, widgets will
28: * also provide a higher-level <em>typed listener</em> API, that is based
29: * on the standard <code>java.util.EventListener</code> pattern.
30: * </p>
31: * <p>
32: * Note that, since all internal SWT event dispatching is based on untyped
33: * listeners, it is simple to build subsets of SWT for use on memory
34: * constrained, small footprint devices, by removing the classes and
35: * methods which implement the typed listener API.
36: * </p>
37: *
38: * @see Widget#addListener
39: * @see java.util.EventListener
40: * @see org.eclipse.swt.events
41: */
42: public interface Listener {
43:
44: /**
45: * Sent when an event that the receiver has registered for occurs.
46: *
47: * @param event the event which occurred
48: */
49: void handleEvent(Event event);
50: }
|