X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerToolTip.java;h=ba42e58927464122a0a9df43c8665cedaf69737a;hb=9f0c99fef54ba18601849682a9cace860393c0d9;hp=f23d4ee1943ae1afb6ce4b1cb167ff197b473c7f;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerToolTip.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerToolTip.java index f23d4ee19..ba42e5892 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerToolTip.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/GraphExplorerToolTip.java @@ -5,6 +5,7 @@ import org.eclipse.swt.graphics.Point; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; import org.eclipse.swt.widgets.TreeItem; import org.simantics.browsing.ui.BuiltinKeys; import org.simantics.browsing.ui.NodeContext; @@ -44,6 +45,21 @@ public class GraphExplorerToolTip extends ToolTip { TreeItem treeItem = parent.getItem(new Point(event.x, event.y)); if (treeItem == null) return false; + // Locate the column, and add the column reference to Event object. + TreeColumn columns[] = parent.getColumns(); + TreeColumn column = null; + int x = 0; + for (TreeColumn c : columns) { + int w = c.getWidth(); + if (event.x >= x && event.x < (x+w)) { + column = c; + break; + } + x+=w; + } + if (column != null) + event.data = column.getData(); + GENodeQueryManager manager = new GENodeQueryManager(explorerContext, null, null, TreeItemReference.create(treeItem.getParentItem())); nodeContext = (NodeContext) treeItem.getData(); if (nodeContext != null)