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
}\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
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