|
Lines 14-20
Link Here
|
| 14 |
import java.util.Iterator; |
14 |
import java.util.Iterator; |
| 15 |
import java.util.List; |
15 |
import java.util.List; |
| 16 |
|
16 |
|
| 17 |
import org.eclipse.core.runtime.Platform; |
|
|
| 18 |
import org.eclipse.swt.dnd.DND; |
17 |
import org.eclipse.swt.dnd.DND; |
| 19 |
import org.eclipse.swt.dnd.DropTargetEvent; |
18 |
import org.eclipse.swt.dnd.DropTargetEvent; |
| 20 |
import org.eclipse.swt.dnd.DropTargetListener; |
19 |
import org.eclipse.swt.dnd.DropTargetListener; |
|
Lines 164-170
Link Here
|
| 164 |
// operation change. otherwise the new listener would get a dragEnter |
163 |
// operation change. otherwise the new listener would get a dragEnter |
| 165 |
// followed by a dragOperationChanged with the exact same event. |
164 |
// followed by a dragOperationChanged with the exact same event. |
| 166 |
if (newListener != null && newListener == oldListener) { |
165 |
if (newListener != null && newListener == oldListener) { |
| 167 |
Platform.run(new SafeRunnable() { |
166 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 168 |
public void run() throws Exception { |
167 |
public void run() throws Exception { |
| 169 |
newListener.dragOperationChanged(event); |
168 |
newListener.dragOperationChanged(event); |
| 170 |
} |
169 |
} |
|
Lines 190-196
Link Here
|
| 190 |
// drag over. otherwise the new listener would get a dragEnter |
189 |
// drag over. otherwise the new listener would get a dragEnter |
| 191 |
// followed by a dragOver with the exact same event. |
190 |
// followed by a dragOver with the exact same event. |
| 192 |
if (newListener != null && newListener == oldListener) { |
191 |
if (newListener != null && newListener == oldListener) { |
| 193 |
Platform.run(new SafeRunnable() { |
192 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 194 |
public void run() throws Exception { |
193 |
public void run() throws Exception { |
| 195 |
newListener.dragOver(event); |
194 |
newListener.dragOver(event); |
| 196 |
} |
195 |
} |
|
Lines 210-216
Link Here
|
| 210 |
// System.out.println("Drop: " + toString()); //$NON-NLS-1$ |
209 |
// System.out.println("Drop: " + toString()); //$NON-NLS-1$ |
| 211 |
updateCurrentListener(event); |
210 |
updateCurrentListener(event); |
| 212 |
if (getCurrentListener() != null) { |
211 |
if (getCurrentListener() != null) { |
| 213 |
Platform.run(new SafeRunnable() { |
212 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 214 |
public void run() throws Exception { |
213 |
public void run() throws Exception { |
| 215 |
getCurrentListener().drop(event); |
214 |
getCurrentListener().drop(event); |
| 216 |
} |
215 |
} |
|
Lines 229-235
Link Here
|
| 229 |
// if (Policy.DEBUG_DRAG_DROP) |
228 |
// if (Policy.DEBUG_DRAG_DROP) |
| 230 |
// System.out.println("Drop Accept: " + toString()); //$NON-NLS-1$ |
229 |
// System.out.println("Drop Accept: " + toString()); //$NON-NLS-1$ |
| 231 |
if (getCurrentListener() != null) { |
230 |
if (getCurrentListener() != null) { |
| 232 |
Platform.run(new SafeRunnable() { |
231 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 233 |
public void run() throws Exception { |
232 |
public void run() throws Exception { |
| 234 |
getCurrentListener().dropAccept(event); |
233 |
getCurrentListener().dropAccept(event); |
| 235 |
} |
234 |
} |
|
Lines 318-324
Link Here
|
| 318 |
if (currentListener == listener) |
317 |
if (currentListener == listener) |
| 319 |
return false; |
318 |
return false; |
| 320 |
if (currentListener != null) { |
319 |
if (currentListener != null) { |
| 321 |
Platform.run(new SafeRunnable() { |
320 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 322 |
public void run() throws Exception { |
321 |
public void run() throws Exception { |
| 323 |
currentListener.dragLeave(event); |
322 |
currentListener.dragLeave(event); |
| 324 |
} |
323 |
} |
|
Lines 328-334
Link Here
|
| 328 |
// if (Policy.DEBUG_DRAG_DROP) |
327 |
// if (Policy.DEBUG_DRAG_DROP) |
| 329 |
// System.out.println("Current drop listener: " + listener); //$NON-NLS-1$ |
328 |
// System.out.println("Current drop listener: " + listener); //$NON-NLS-1$ |
| 330 |
if (currentListener != null) { |
329 |
if (currentListener != null) { |
| 331 |
Platform.run(new SafeRunnable() { |
330 |
SafeRunnable.getRunner().run(new SafeRunnable() { |
| 332 |
public void run() throws Exception { |
331 |
public void run() throws Exception { |
| 333 |
currentListener.dragEnter(event); |
332 |
currentListener.dragEnter(event); |
| 334 |
} |
333 |
} |