]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
GraphExplorerComposite now accepts TextTransfer and MOVE/DEFAULT dnd ops 89/289/1
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 23 Jan 2017 18:56:03 +0000 (20:56 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Mon, 23 Jan 2017 18:56:03 +0000 (20:56 +0200)
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

bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/widgets/GraphExplorerComposite.java

index 3ee82ae3b319b944c25b29337d68a27da05d7489..4b5a48e14acdb79f0cee6f1e42a798b2b142312b 100644 (file)
@@ -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) {