]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerMouseAdapter.java
Sync git svn branch with SVN repository r33144.
[simantics/platform.git] / bundles / org.simantics.browsing.ui.swt / src / org / simantics / browsing / ui / swt / GraphExplorerMouseAdapter.java
index 9a28ed4f2f3df09ed8a33c60d25137acec94cdaf..77b1b1a5355294f4007c69a6b71ffb4995724f05 100644 (file)
@@ -16,9 +16,7 @@ import org.eclipse.jface.viewers.ISelectionProvider;
 import org.eclipse.jface.viewers.StructuredSelection;\r
 import org.eclipse.swt.events.MouseAdapter;\r
 import org.eclipse.swt.events.MouseEvent;\r
-import org.eclipse.swt.graphics.Point;\r
-import org.eclipse.swt.widgets.Tree;\r
-import org.eclipse.swt.widgets.TreeItem;\r
+import org.eclipse.swt.widgets.Control;\r
 import org.simantics.browsing.ui.GraphExplorer;\r
 import org.simantics.browsing.ui.NodeContext;\r
 import org.simantics.utils.ui.AdaptionUtils;\r
@@ -47,15 +45,19 @@ public class GraphExplorerMouseAdapter extends MouseAdapter {
     }\r
 \r
     protected ISelection getClickedContext(MouseEvent e) {\r
-        final Tree tree = (Tree) e.getSource();\r
-        Point point = new Point(e.x, e.y);\r
-        TreeItem item = tree.getItem(point);\r
-\r
-        // No selectable item at point?\r
-        if (item == null)\r
-            return null;\r
-\r
-        Object data = item.getData();\r
+//        final Tree tree = (Tree) e.getSource();\r
+//        Point point = new Point(e.x, e.y);\r
+//        TreeItem item = tree.getItem(point);\r
+//\r
+//        // No selectable item at point?\r
+//        if (item == null)\r
+//            return null;\r
+//\r
+//        Object data = item.getData();\r
+       Object data = ge.getClicked(e);\r
+       if (data == null)\r
+               return null;\r
+       \r
         NodeContext context = AdaptionUtils.adaptToSingle(data, NodeContext.class);\r
         if (context == null)\r
             return null;\r
@@ -81,11 +83,11 @@ public class GraphExplorerMouseAdapter extends MouseAdapter {
         if (context == null)\r
             return;\r
 \r
-        Tree tree = (Tree) e.getSource();\r
+        Control tree = (Control)e.getSource();\r
         handleContextDoubleClick(tree, context);\r
     }\r
 \r
-    protected void handleContextDoubleClick(Tree tree, ISelection selection) {\r
+    protected void handleContextDoubleClick(Control tree, ISelection selection) {\r
     }\r
 \r
 }\r