}
private class ScriptRunningDropTarget extends DropTargetAdapter {
+ @Override
+ public void dragEnter(DropTargetEvent event) {
+ if (event.detail == DND.DROP_DEFAULT) {
+ event.detail = DND.DROP_LINK;
+ }
+ }
+
+ @Override
+ public void dragOperationChanged(DropTargetEvent event) {
+ if (event.detail == DND.DROP_DEFAULT) {
+ event.detail = DND.DROP_LINK;
+ }
+ }
+
public void drop(DropTargetEvent event) {
if (FileTransfer.getInstance().isSupportedType(event.currentDataType)) {
String[] files = ((String[]) event.data).clone();
}
private void addScriptDropSupport(SCLConsole console) {
- DropTarget target = new DropTarget(console.getOutputWidget(), DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT);
+ DropTarget target = new DropTarget(console.getOutputWidget(), DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT);
target.setTransfer(new Transfer[] { FileTransfer.getInstance() });
target.addDropListener(new ScriptRunningDropTarget());
}