1 /*******************************************************************************
2 * Copyright (c) 2000, 2011 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.widgets;
18 * Implementers of <code>Listener</code> provide a simple
19 * <code>handleEvent()</code> method that is used internally
20 * by SWT to dispatch events.
22 * After creating an instance of a class that implements this interface
23 * it can be added to a widget using the
24 * <code>addListener(int eventType, Listener handler)</code> method and
26 * <code>removeListener (int eventType, Listener handler)</code> method.
27 * When the specified event occurs, <code>handleEvent(...)</code> will
28 * be sent to the instance.
31 * Classes which implement this interface are described within SWT as
32 * providing the <em>untyped listener</em> API. Typically, widgets will
33 * also provide a higher-level <em>typed listener</em> API, that is based
34 * on the standard <code>java.util.EventListener</code> pattern.
37 * Note that, since all internal SWT event dispatching is based on untyped
38 * listeners, it is simple to build subsets of SWT for use on memory
39 * constrained, small footprint devices, by removing the classes and
40 * methods which implement the typed listener API.
43 * @see Widget#addListener
44 * @see java.util.EventListener
45 * @see org.eclipse.swt.events
47 public interface Listener {
50 * Sent when an event that the receiver has registered for occurs.
52 * @param event the event which occurred
54 void handleEvent (Event event);