Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: f47370a7c6f7c4dc4e1c1442bf5ff7cc9911c9d4 (plain) (blame)
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
package org.eclipse.swt.dnd;

/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved
 */
import org.eclipse.swt.events.TypedEvent;

/**
 * The DragSourceEvent contains the event information passed in the methods of the DragSourceListener.
 * 
 * <p>dragStart : When a drag operation is about to being, the following fields apply:
 * <ul>
 * <li>widget   - (in) the DragSource object that is initiating the drag
 * <li>time     - (in) the time the drag action occurred
 * <li>doit     - (out) the application can set this value to false to prevent the drag from starting. Set to true by default.
 * </ul></p>
 *
 * <p>dragSetData : When requesting data from the DragSource, the following fields apply:
 * <ul>
 * <li>widget   - (in) the DragSource object that initiated the drag
 * <li>time     - (in) the time the drop occurred
 * <li>dataType - (in) the type of data requested.  This is a TransferData object and can be used with the Transfer subclasses.
 * <li>data     - (out) the application inserts the actual data here (must match the dataType).  This is a Java object and 
 *                      the type of Java object that the application should insert here depends on the data type.  
 *						For example, a TextTransfer requires a Java String containing the text; a FileTransfer requires 
 *						a Java array of String with each String in the array representing the full path of the file.  
 *						To determine what type of object you need to place in this field, consult the description of 
 *						the Transfer subclass
 * </ul></p>
 *
 * <p>dragFinished : When a drag operation has been completed, the following fields apply:
 * <ul>
 * <li>widget   - (in) the DragSource object that initiated the drag
 * <li>time     - (in) the time the drop occurred
 * <li>doit     - (in) true if the operation performed successfully
 * <li>detail   - (in) the operation that was performed (DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 */
 
public class DragSourceEvent extends TypedEvent {
 	public int detail;
 	public boolean doit;

 	/**
	 *  Platform specific information about the type of data being transferred.
 	 */
	public TransferData dataType;

public DragSourceEvent(DNDEvent e) {
	super(e);
	this.data = e.data;
	this.detail = e.detail;
	this.doit = e.doit;
	this.dataType = e.dataType;
}
void updateEvent(DNDEvent e) {
	e.widget = this.widget;
	e.time = this.time;
	e.data = this.data;
	e.detail = this.detail;
	e.doit = this.doit;
	e.dataType = this.dataType;
}
}

Back to the top