summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/events/SelectionEvent.java
blob: 2d604cbb78972a8170cb69382d3173896e6cac17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*******************************************************************************
 * Copyright (c) 2000, 2003 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.swt.events;


import org.eclipse.swt.widgets.*;

/**
 * Instances of this class are sent as a result of
 * widgets being selected.
 * <p>
 * Note: The fields that are filled in depend on the widget.
 * </p>
 *
 * @see SelectionListener
 */

public class SelectionEvent extends TypedEvent {
	
	/**
	 * the item that was selected
	 */
	public Widget item;
	
	/**
	 * extra detail information about the selection, depending on the widget
	 * <p><b>Sash</b><ul>
	 * <li>{@link SWT#DRAG}</li>
	 * </ul></p><p><b>ScrollBar and Slider</b><ul>
	 * <li>{@link SWT#DRAG}</li>
	 * <li>{@link SWT#HOME}</li>
	 * <li>{@link SWT#END}</li>
	 * <li>{@link SWT#ARROW_DOWN}</li>
	 * <li>{@link SWT#ARROW_UP}</li>
	 * <li>{@link SWT#PAGE_DOWN}</li>
	 * <li>{@link SWT#PAGE_UP}</li>
	 * </ul></p><p><b>Table, Tree and TableTree</b><ul>
	 * <li>{@link SWT#CHECK}</li>
	 * </ul></p><p><b>CoolItem and ToolItem</b><ul>
	 * <li>{@link SWT#ARROW}</li>
	 * </ul></p>
	 */
	public int detail;

	/**
	 * the x location of the selected area
	 */
	public int x;
	
	/**
	 * the y location of selected area
	 */
	public int y;
	
	/**
	 * the width of selected area
	 */
	public int width;
	
	/**
	 * the height of selected area
	 */
	public int height;

	/**
	 * the state of the keyboard modifier keys at the time
	 * the event was generated.
	 */
	public int stateMask;

	/**
	 * a flag indicating whether the operation should be allowed
	 */
	public boolean doit;
	
/**
 * Constructs a new instance of this class based on the
 * information in the given untyped event.
 *
 * @param e the untyped event containing the information
 */
public SelectionEvent(Event e) {
	super(e);
	this.item = e.item;
	this.x = e.x;
	this.y = e.y;
	this.width = e.width;
	this.height = e.height;
	this.detail = e.detail;
	this.stateMask = e.stateMask;
	this.doit = e.doit;
}

}