Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 332491

Summary: Required to dynamically change the tooltip on a connection or shape
Product: [Modeling] Graphiti Reporter: Panneer Selvam <selvam.jp>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: hrr, juergen.pasch, michael.wenz
Version: unspecifiedFlags: michael.wenz: indigo+
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Indigo M5 theme_round_offs

Description Panneer Selvam CLA 2010-12-13 23:49:57 EST
Build Identifier: 0.7.0

Hi,

Currently I define the tooltips for connections and shapes in ToolBehaviorProvider before the diagram is rendored. As a result I would not be able to change the tooltip later.

I have a requirement that the names in shapes in the diagram can be changed by the user. In such cases, I would also expect the tooltip to be changed.

Could you provide a way to specify the tootips dynamically either at the time mouse-over or at the time of changing the text for a shape?

Regards,
Panneer

Reproducible: Always
Comment 1 Michael Wenz CLA 2010-12-16 07:18:00 EST
Also other tooltips besides of strings should be supported
Comment 2 Michael Wenz CLA 2010-12-16 09:27:17 EST
Of course M5 not M4
Comment 3 Juergen Pasch CLA 2011-01-28 07:45:06 EST
Hi Panneer,
the functionality you requested is already available. Whenever business objects are changed, tooltips are also refreshed accordingly, e.g. when you are renaming a shape. I this O.K. for you?
Regards,
Juergen
Comment 4 Juergen Pasch CLA 2011-02-01 08:33:33 EST
Hi Panneer,
add the following code snippet to the TutorialToolBehaviorProvider of our tutorial plug-in, which implements tooltips for EClass shapes:

@Override
public String getToolTip(GraphicsAlgorithm ga) {
   PictogramElement pe = ga.getPictogramElement();
   Object bo = getFeatureProvider().getBusinessObjectForPictogramElement(pe);
   if (bo instanceof EClass) {
      return ((EClass) bo).getName();
   }
   return super.getToolTip(ga);
}

You will see renaming an EClass will change the tooltip.
Regards,
Juergen
Comment 5 Michael Wenz CLA 2011-06-24 09:08:13 EDT
Part of Graphiti Indigo 0.8.0