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

Bug 460075

Summary: Have tooltip on decorations
Product: [Modeling] Sirius Reporter: Esteban DUGUEPEROUX <esteban.dugueperoux>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: enhancement    
Priority: P3 CC: florian.barbin, laurent.redor, maxime.porhel
Version: 2.0.0Keywords: triaged
Target Milestone: 3.1.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/42040
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bbce07fde3952d2189c088df686e3a4871b1d115
https://git.eclipse.org/r/56827
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=4fa8dd13236f17f3d3e7dfc16e1487b9f7d69bec
Whiteboard:

Description Esteban DUGUEPEROUX CLA 2015-02-17 03:25:55 EST
It would be usefull to allows tooltip contribution on tree/table dialect editors with "org.eclipse.ui.decorators" extension point.
This can be enabled by calling "ColumnViewerToolTipSupport.enableFor(treeViewer);" in TreeViewer construction and having LabelProvider override CellLabelProvider.getToolTipText() to delegate to a decorator as it is done for image decoration currently, see DTableDecoratingLabelProvider.getImage().

http://davymeers.net/2010/07/04/jface-using-columnviewers-combined-with-decoration-and-custom-tooltips/ is a good documentation to know how to do it.
Comment 1 Maxime Porhel CLA 2015-02-17 05:37:06 EST
Note that in Diagram dialect, the specifier has the possibility to define the tooltip in the VSM
Comment 2 Eclipse Genie CLA 2015-02-17 09:27:29 EST
New Gerrit change created: https://git.eclipse.org/r/42040
Comment 3 Esteban DUGUEPEROUX CLA 2015-02-17 09:32:14 EST
For diagram, we will not collide with tooltip expression of odesign because the tooltip will be displayed only on decorations.
Comment 5 Esteban DUGUEPEROUX CLA 2015-09-08 09:05:04 EDT
Fixed.
Comment 6 Laurent Redor CLA 2015-09-23 09:49:43 EDT
I have a case (not reproductible) with this stack :
org.eclipse.core.runtime.AssertionFailedException: null argument:
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:85)
	at org.eclipse.core.runtime.Assert.isNotNull(Assert.java:73)
	at org.eclipse.core.internal.runtime.AdapterManager.getAdapter(AdapterManager.java:296)
	at org.eclipse.sirius.diagram.ui.tools.api.decorators.AbstractSiriusDecorator.getToolTipText(AbstractSiriusDecorator.java:112)
	at org.eclipse.sirius.diagram.ui.tools.api.decorators.AbstractSiriusDecorator.refreshTooltip(AbstractSiriusDecorator.java:101)
	at org.eclipse.sirius.diagram.ui.tools.api.decorators.AbstractSiriusDecorator.addDecoration(AbstractSiriusDecorator.java:239)
	at org.eclipse.sirius.diagram.ui.tools.api.decorators.AbstractSiriusDecorator.refresh(AbstractSiriusDecorator.java:90)
	at org.eclipse.gmf.runtime.diagram.ui.editpolicies.DecorationEditPolicy.refresh(DecorationEditPolicy.java:189)

A check (!= null) must probably be added somewhere.
Comment 7 Eclipse Genie CLA 2015-09-28 06:04:26 EDT
New Gerrit change created: https://git.eclipse.org/r/56827
Comment 9 Laurent Redor CLA 2015-09-29 08:23:32 EDT
The problem of comment 6 has been resolved with above commit.
Comment 10 Florian Barbin CLA 2015-10-09 04:31:20 EDT
Verified on Sirius 3.1.0.201510081411
Comment 11 Pierre-Charles David CLA 2015-10-16 09:10:18 EDT
Available in Sirius 3.1.0.