KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > swt > events > SelectionListener


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 package org.eclipse.swt.events;
12
13
14 import org.eclipse.swt.internal.SWTEventListener;
15
16 /**
17  * Classes which implement this interface provide methods
18  * that deal with the events that are generated when selection
19  * occurs in a control.
20  * <p>
21  * After creating an instance of a class that implements
22  * this interface it can be added to a control using the
23  * <code>addSelectionListener</code> method and removed using
24  * the <code>removeSelectionListener</code> method. When
25  * selection occurs in a control the appropriate method
26  * will be invoked.
27  * </p>
28  *
29  * @see SelectionAdapter
30  * @see SelectionEvent
31  */

32 public interface SelectionListener extends SWTEventListener {
33
34 /**
35  * Sent when selection occurs in the control.
36  * <p>
37  * For example, selection occurs in a List when the user selects
38  * an item or items with the keyboard or mouse. On some platforms,
39  * the event occurs when a mouse button or key is pressed. On others,
40  * it happens when the mouse or key is released. The exact key or
41  * mouse gesture that causes this event is platform specific.
42  * </p>
43  *
44  * @param e an event containing information about the selection
45  */

46 public void widgetSelected(SelectionEvent e);
47
48 /**
49  * Sent when default selection occurs in the control.
50  * <p>
51  * For example, on some platforms default selection occurs in a List
52  * when the user double-clicks an item or types return in a Text.
53  * On some platforms, the event occurs when a mouse button or key is
54  * pressed. On others, it happens when the mouse or key is released.
55  * The exact key or mouse gesture that causes this event is platform
56  * specific.
57  * </p>
58  *
59  * @param e an event containing information about the default selection
60  */

61 public void widgetDefaultSelected(SelectionEvent e);
62 }
63
Popular Tags