X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.graph.impl%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fgraph%2Fimpl%2Fcontributor%2Flabeler%2FColumnLabelerContributorImpl.java;h=51963dce2d669bd8b9a3e1cb24c659db058829d2;hb=HEAD;hp=d1dab0fb97adc521097769b14d88e115f15be79f;hpb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;p=simantics%2Fplatform.git 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 d1dab0fb9..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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * Copyright (c) 2007, 2018 Association for Decentralized Information Management * in Industry THTH ry. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,9 +8,11 @@ * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation + * Semantum Oy - gitlab #146 - tooltip support *******************************************************************************/ package org.simantics.browsing.ui.graph.impl.contributor.labeler; +import java.util.HashMap; import java.util.Map; import org.simantics.browsing.ui.BuiltinKeys; @@ -55,6 +57,14 @@ abstract public class ColumnLabelerContributorImpl implements Contributor auxiliary) { + return false; + } + + public Object createToolTipContentArea(Object event, Object parent, T input, Map auxiliary) { + return null; + } + @Override public LabelerFactory getFactory() { @@ -99,6 +109,24 @@ 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, auxiliary); + } + + @Override + public Object createToolTipContent(Object event, Object parent, NodeContext nodeContext) { + T input = (T)context.getConstant(BuiltinKeys.INPUT); + try { + return ColumnLabelerContributorImpl.this.createToolTipContentArea(event, parent, input, auxiliary); + } finally { + auxiliary.clear(); + } + } };