From: Tuukka Lehtonen Date: Mon, 23 Jan 2017 18:56:03 +0000 (+0200) Subject: GraphExplorerComposite now accepts TextTransfer and MOVE/DEFAULT dnd ops X-Git-Tag: v1.27.0~5 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=d615f9ce52ccde4f0de408d6345d033faa4590e6;p=simantics%2Fplatform.git GraphExplorerComposite now accepts TextTransfer and MOVE/DEFAULT dnd ops TextTransfer must be enabled to allow JSON drops into the model browser. The MOVE and DEFAULT drag operations are allowed to see if this affects people with problems dragging files from system file explorer to the model browser. refs #6997 Change-Id: I740a8b29e7f43c5215748e0a0a193560ccbf600f --- diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java index 3ee82ae3b..4b5a48e14 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java @@ -529,7 +529,7 @@ public class GraphExplorerComposite extends Composite implements Widget, IAdapta //tree.getTree().setLayout(new FillLayout() //this.setLayout(LayoutUtils.createNoBorderGridLayout(2, false)); - DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_LINK); + DropTarget target = new DropTarget(control, DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK | DND.DROP_DEFAULT); target.setTransfer(getAcceptedDataTypes()); if (control instanceof Tree) { target.addDropListener(new DropTargetListener() { @@ -694,7 +694,7 @@ public class GraphExplorerComposite extends Composite implements Widget, IAdapta } protected Transfer[] getAcceptedDataTypes() { - return new Transfer[] { LocalObjectTransfer.getTransfer(), FileTransfer.getInstance() }; + return new Transfer[] { LocalObjectTransfer.getTransfer(), FileTransfer.getInstance(), TextTransfer.getInstance() }; } protected void handleDrop(Object data, NodeContext target) {