From 60635a17a7cc33eb44bd6aecd1a25b51b9ad029d Mon Sep 17 00:00:00 2001 From: Marko Luukkainen Date: Mon, 26 Nov 2018 13:18:34 +0200 Subject: [PATCH] Passing data between tooltip check and content creation. gitlab #146 Change-Id: I415f79b182cacbeca9999aacc50ac920c31a344b (cherry picked from commit 2309629a2b9cb57e86c3b34bf8d94f2bdfd5a1ef) --- .../labeler/ColumnLabelerContributorImpl.java | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/contributor/labeler/ColumnLabelerContributorImpl.java b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/contributor/labeler/ColumnLabelerContributorImpl.java index 47dcf92c2..51963dce2 100644 --- a/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/contributor/labeler/ColumnLabelerContributorImpl.java +++ b/bundles/org.simantics.browsing.ui.graph.impl/src/org/simantics/browsing/ui/graph/impl/contributor/labeler/ColumnLabelerContributorImpl.java @@ -12,6 +12,7 @@ *******************************************************************************/ package org.simantics.browsing.ui.graph.impl.contributor.labeler; +import java.util.HashMap; import java.util.Map; import org.simantics.browsing.ui.BuiltinKeys; @@ -56,11 +57,11 @@ abstract public class ColumnLabelerContributorImpl implements Contributor auxiliary) { return false; } - public Object createToolTipContentArea(Object event, Object parent, T input) { + public Object createToolTipContentArea(Object event, Object parent, T input, Map auxiliary) { return null; } @@ -108,17 +109,23 @@ abstract public class ColumnLabelerContributorImpl implements Contributor auxiliary = new HashMap<>(); @Override public boolean createToolTip(Object event, NodeContext nodeContext) { T input = (T)context.getConstant(BuiltinKeys.INPUT); - return ColumnLabelerContributorImpl.this.shouldCreateToolTip(event, input); + return ColumnLabelerContributorImpl.this.shouldCreateToolTip(event, input, auxiliary); } @Override public Object createToolTipContent(Object event, Object parent, NodeContext nodeContext) { T input = (T)context.getConstant(BuiltinKeys.INPUT); - return ColumnLabelerContributorImpl.this.createToolTipContentArea(event, parent, input); + try { + return ColumnLabelerContributorImpl.this.createToolTipContentArea(event, parent, input, auxiliary); + } finally { + auxiliary.clear(); + } } }; -- 2.47.1