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.events;
11:
12: import org.eclipse.swt.internal.SWTEventListener;
13:
14: /**
15: * Classes which implement this interface provide methods
16: * that deal with the events that are generated when selection
17: * occurs in a control.
18: * <p>
19: * After creating an instance of a class that implements
20: * this interface it can be added to a control using the
21: * <code>addSelectionListener</code> method and removed using
22: * the <code>removeSelectionListener</code> method. When
23: * selection occurs in a control the appropriate method
24: * will be invoked.
25: * </p>
26: *
27: * @see SelectionAdapter
28: * @see SelectionEvent
29: */
30: public interface SelectionListener extends SWTEventListener {
31:
32: /**
33: * Sent when selection occurs in the control.
34: * <p>
35: * For example, selection occurs in a List when the user selects
36: * an item or items with the keyboard or mouse. On some platforms,
37: * the event occurs when a mouse button or key is pressed. On others,
38: * it happens when the mouse or key is released. The exact key or
39: * mouse gesture that causes this event is platform specific.
40: * </p>
41: *
42: * @param e an event containing information about the selection
43: */
44: public void widgetSelected(SelectionEvent e);
45:
46: /**
47: * Sent when default selection occurs in the control.
48: * <p>
49: * For example, on some platforms default selection occurs in a List
50: * when the user double-clicks an item or types return in a Text.
51: * On some platforms, the event occurs when a mouse button or key is
52: * pressed. On others, it happens when the mouse or key is released.
53: * The exact key or mouse gesture that causes this event is platform
54: * specific.
55: * </p>
56: *
57: * @param e an event containing information about the default selection
58: */
59: public void widgetDefaultSelected(SelectionEvent e);
60: }
|