Mercurial > projects > dwt-mac
comparison dwt/widgets/Listener.d @ 0:380af2bdd8e5
Upload of whole dwt tree
author | Jacob Carlborg <doob@me.com> <jacob.carlborg@gmail.com> |
---|---|
date | Sat, 09 Aug 2008 17:00:02 +0200 |
parents | |
children | 2952d5604c0a |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:380af2bdd8e5 |
---|---|
1 /******************************************************************************* | |
2 * Copyright (c) 2000, 2005 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 *******************************************************************************/ | |
11 module dwt.widgets.Listener; | |
12 | |
13 import dwt.dwthelper.utils; | |
14 | |
15 | |
16 /** | |
17 * Implementers of <code>Listener</code> provide a simple | |
18 * <code>handleEvent()</code> method that is used internally | |
19 * by DWT to dispatch events. | |
20 * <p> | |
21 * After creating an instance of a class that implements this interface | |
22 * it can be added to a widget using the | |
23 * <code>addListener(int eventType, Listener handler)</code> method and | |
24 * removed using the | |
25 * <code>removeListener (int eventType, Listener handler)</code> method. | |
26 * When the specified event occurs, <code>handleEvent(...)</code> will | |
27 * be sent to the instance. | |
28 * </p> | |
29 * <p> | |
30 * Classes which implement this interface are described within DWT as | |
31 * providing the <em>untyped listener</em> API. Typically, widgets will | |
32 * also provide a higher-level <em>typed listener</em> API, that is based | |
33 * on the standard <code>java.util.EventListener</code> pattern. | |
34 * </p> | |
35 * <p> | |
36 * Note that, since all internal DWT event dispatching is based on untyped | |
37 * listeners, it is simple to build subsets of DWT for use on memory | |
38 * constrained, small footprint devices, by removing the classes and | |
39 * methods which implement the typed listener API. | |
40 * </p> | |
41 * | |
42 * @see Widget#addListener | |
43 * @see java.util.EventListener | |
44 * @see dwt.events | |
45 */ | |
46 public interface Listener { | |
47 | |
48 /** | |
49 * Sent when an event that the receiver has registered for occurs. | |
50 * | |
51 * @param event the event which occurred | |
52 */ | |
53 void handleEvent (Event event); | |
54 } |