Community
Participate
Working Groups
Currently tooltip expressions are computed for each element during each refresh, and stored (in a way that is similar to labels) directly inside the model. This has a (small but still present) overhead in refresh time, in load/save time, in memory usage (keeping hunderds/thousands or strings in memory), and can make diagrams "dirty" for no visible reason if the tooltip computation is not stable. I don't see any obvious drawback with computing them on-demand. Tooltips only appear after the user has stopped the mouse cursor on an element for something like 500ms. An additional delay of 1 or 2ms to compute the expression should not be detectable.
This can also induce unexpected dirty session state, as for example with ecoretools and the bug 494270.
Some code pointers/rough ideas: * In DDiagramElementSynchronizer.refreshTooltip(DDiagramElement, TooltipStyleDescription): transmit the raw expression (unevaluated) * Then in all of AbstractDiagramNameEditPart.refreshVisuals(), DiagramContainerEditPartOperation.refreshVisuals(AbstractDiagramElementContainerEditPart), DiagramNodeEditPartOperation.refreshFigure(IStyleEditPart), AbstractDiagramNodeEditPartOperation.setTooltipText(IAbstractDiagramNodeEditPart, String), create a Label which only computes the expression once (per refreshVisual() invocation), at paintFigure()-time.