@Override public boolean performDrop(final Object data) { try { final int currentOperation= getCurrentOperation(); if (data == null || !(data instanceof String[]) || currentOperation != DND.DROP_COPY) return false; final IContainer target= getActualTarget(getCurrentTarget()); if (target == null) return false; // Run the import operation asynchronously. // Otherwise the drag source (e.g., Windows Explorer) will be blocked // while the operation executes. Fixes bug 35796. Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { getShell().forceActive(); new CopyFilesAndFoldersOperation(getShell()).copyOrLinkFiles((String[])data, target, currentOperation); } }); return true; } catch (JavaModelException e) { String title= PackagesMessages.DropAdapter_errorTitle; String message= PackagesMessages.DropAdapter_errorMessage; ExceptionHandler.handle(e, getShell(), title, message); return false; } }
@Override public boolean performDrop(final Object data) { try { final int currentOperation= getCurrentOperation(); if (data == null || !(data instanceof String[]) || currentOperation != DND.DROP_COPY) return false; final IContainer target= getActualTarget(getCurrentTarget()); if (target == null) return false; // Run the import operation asynchronously. // Otherwise the drag source (e.g., Windows Explorer) will be blocked // while the operation executes. Fixes bug 35796. Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { getShell().forceActive(); new CopyFilesAndFoldersOperation(getShell()).copyOrLinkFiles((String[])data, target, currentOperation); } }); return true; } catch (JavaModelException e) { String title= PackagesMessages.DropAdapter_errorTitle; String message= PackagesMessages.DropAdapter_errorMessage; ExceptionHandler.handle(e, getShell(), title, message); return false; } }