From d615f9ce52ccde4f0de408d6345d033faa4590e6 Mon Sep 17 00:00:00 2001 From: Tuukka Lehtonen Date: Mon, 23 Jan 2017 20:56:03 +0200 Subject: [PATCH] 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 --- .../browsing/ui/swt/widgets/GraphExplorerComposite.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.43.2