Skip to main content
summaryrefslogtreecommitdiffstats
blob: acd9e09f69b13608468b8567e881ca001c46ddc2 (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
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
package org.eclipse.swt.dnd;

/*
 * Licensed Materials - Property of IBM,
 * WebSphere Studio Workbench
 * (c) Copyright IBM Corp 2000
 */
import org.eclipse.swt.graphics.*;
import java.util.EventListener;

/**
 * The <code>DropTargetListener</code> class provides event notification to the application for DropTarget events.
 *
 * <p>As the user moves the cursor into, over and out of a Control that has been designated as a DropTarget, events
 * indicate what operation can be performed and what data can be transferred if a drop where to occur at that point.
 * The application can respond to these events and change the type of data that will be dropped, change the operation 
 * that will be performed or stop any drop from happening on the current target.</p>
 *
 * <p>When the user causes a drop to happen by releasing the mouse over a valid drop target, the application has one 
 * last chance to change the data type of the drop through the DropAccept event.  If the drop is still allowed, the 
 * DropAccept event is immediately followed by the Drop event.  In the Drop event, the application can still change the
 * operation that is performed but the data type is fixed.</p>
 *
 */
public interface DropTargetListener extends EventListener {
/**
 * The cursor has entered the drop target boundaries.
 *
 * <p>The following fields in the DropTargetEvent apply:
 * <ul>
 * <li>(in)widget        - the DragSource object that initiated the drag
 * <li>(in)time          - the time the drop occurred
 * <li>(in)x             - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y             - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)dataTypes     - a list of the types of data that the <code>DragSource</code> can support
 * <li>(in,out)currentDataType - the specific type of data that will be provided
 * <li>(in)operations    - a list of the operations that the DragSource can support (e.g. <code>DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK</code>)
 * <li>(in,out)detail   - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 * <p>The application can change the operation that will be performed by modifying the <code>detail</code> field 
 * but the choice must be one of the values in the <code>operations</code> field.  
 * The application can also change the type of data being requested by modifying the <code>currentDataTypes</code>
 * field  but the value must be one of the values in the <code>dataTypes</code> list.</p>
 *
 * @param event  the information associated with the drag enter event
 *
 */
public void dragEnter(DropTargetEvent event);
/**
 * The cursor has left the drop target boundaries.
 *
 * <p>The following fields in the DropTargetEvent apply:
 * <ul>
 * <li>(in)widget        - the DragSource object that initiated the drag
 * <li>(in)time          - the time the drop occurred
 * <li>(in)x             - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y             - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)dataTypes     - a list of the types of data that the <code>DragSource</code> can support
 * <li>(in,out)currentDataType - the specific type of data that will be provided
 * <li>(in)operations    - a list of the operations that the DragSource can support (e.g. <code>DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK</code>)
 * <li>(in,out)detail   - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 * <p>The application can change the operation that will be performed by modifying the <code>detail</code> field 
 * but the choice must be one of the values in the <code>operations</code> field.  
 * The application can also change the type of data being requested by modifying the <code>currentDataTypes</code>
 * field  but the value must be one of the values in the <code>dataTypes</code> list.</p>
 *
 * @param event  the information associated with the drag leave event
 *
 */

public void dragLeave(DropTargetEvent event);
/**
 * The operation being performed has changed (usually due to the user changing the selected key while dragging).
 *
 * <p>The following fields in the DropTargetEvent apply:
 * <ul>
 * <li>(in)widget        - the DragSource object that initiated the drag
 * <li>(in)time          - the time the drop occurred
 * <li>(in)x             - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y             - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)dataTypes     - a list of the types of data that the <code>DragSource</code> can support
 * <li>(in,out)currentDataType - the specific type of data that will be provided
 * <li>(in)operations    - a list of the operations that the DragSource can support (e.g. <code>DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK</code>)
 * <li>(in,out)detail   - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 * <p>The application can change the operation that will be performed by modifying the <code>detail</code> field 
 * but the choice must be one of the values in the <code>operations</code> field.  
 * The application can also change the type of data being requested by modifying the <code>currentDataTypes</code>
 * field  but the value must be one of the values in the <code>dataTypes</code> list.</p>
 *
 * @param event  the information associated with the drag operation changed event
 */

public void dragOperationChanged(DropTargetEvent event);
/**
 * The cursor is moving over the drop target.
 *
 * <p>The following fields in the DropTargetEvent apply:
 * <ul>
 * <li>(in)widget        - the DragSource object that initiated the drag
 * <li>(in)time          - the time the drop occurred
 * <li>(in)x             - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y             - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)dataTypes     - a list of the types of data that the <code>DragSource</code> can support
 * <li>(in,out)currentDataType - the specific type of data that will be provided
 * <li>(in)operations    - a list of the operations that the DragSource can support (e.g. <code>DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK</code>)
 * <li>(in,out)detail   - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 * <p>The application can change the operation that will be performed by modifying the <code>detail</code> field 
 * but the choice must be one of the values in the <code>operations</code> field.  
 * The application can also change the type of data being requested by modifying the <code>currentDataTypes</code>
 * field  but the value must be one of the values in the <code>dataTypes</code> list.</p>
 *
 * @param event  the information associated with the drag over event
 *
 */

public void dragOver(DropTargetEvent event);
/**
 * The data is being dropped.
 *
 * <p>The following fields in DropTargetEvent apply:
 * <ul>
 * <li>(in)widget   - the DragSource object that initiated the drag
 * <li>(in)time     - the time the drop occurred
 * <li>(in)x        - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y        - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in,out)detail - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * <li>(in)currentDataType - the specific type of data that will be provided
 * <li>(in)data     - the data (which is of type currentDataType)
 * </ul></p>
 *
 * <p>The application can refuse to perform the drop operation by setting the detail field to DND.DROP_NONE.</p>
 *
 * @param event the information associated with the drop event
 *
 */

public void drop(DropTargetEvent event);
/**
 * The drop target is given the chance to change the nature of the drop.  It can veto the drop by setting the 
 * <code>event.detail</code> field to <code>DND.DROP_NONE</code>, it can change the data of data that will be 
 * dropped by setting the <code>event.currentDataType</code> field to a different value or it can change the 
 * operation that will be performed by changing the <code>event.detail</code> field.
 *
 * <p>The following fields in the DropTargetEvent apply:
 * <ul>
 * <li>(in)widget        - the DragSource object that initiated the drag
 * <li>(in)time          - the time the drop occurred
 * <li>(in)x             - the x-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)y             - the y-cordinate of the cursor relative to the <code>DropTarget Control</code>
 * <li>(in)dataTypes     - a list of the types of data that the <code>DragSource</code> can support
 * <li>(in,out)currentDataType - the specific type of data that will be provided
 * <li>(in)operations    - a list of the operations that the DragSource can support (e.g. <code>DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK</code>)
 * <li>(in,out)detail   - the operation being performed (one of DND.DROP_MOVE, DND.DROP_COPY, DND.DROP_LINK, DND.DROP_NONE)
 * </ul></p>
 *
 * <p>The application can change the operation that will be performed by modifying the <code>detail</code> field 
 * but the choice must be one of the values in the <code>operations</code> field.  
 * The application can also change the type of data being requested by modifying the <code>currentDataTypes</code>
 * field  but the value must be one of the values in the <code>dataTypes</code> list.</p>
 *
 * @param event  the information associated with the drop accept event
 *
 */
public void dropAccept(DropTargetEvent event);
}

Back to the top