X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerToolTip.java;fp=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FGraphExplorerToolTip.java;h=0cc2e71a8c768ddce6c08a2a85cb648794b0a4e5;hp=f23d4ee1943ae1afb6ce4b1cb167ff197b473c7f;hb=972fd5be2b27129dd53bbf885d9a95314e47ddc2;hpb=9cb34326f90e75bf8424b60cd92f0a15806890b4 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..0cc2e71a8 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,19 @@ 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; + } + event.data = column.getData(); GENodeQueryManager manager = new GENodeQueryManager(explorerContext, null, null, TreeItemReference.create(treeItem.getParentItem())); nodeContext = (NodeContext) treeItem.getData(); if (nodeContext != null)