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

Bug 443675

Summary: Bad LabelProvider definition for DLine element
Product: [Modeling] Sirius Reporter: Goulwen Le Fur <goulwen.lefur>
Component: TableAssignee: Belqassim Djafer <belqassim.djafer>
Status: CLOSED FIXED QA Contact: Pierre-Charles David <pierre-charles.david>
Severity: normal    
Priority: P1 CC: belqassim.djafer, cedric.brun, laurent.redor, pierre-charles.david, steve.monnier
Version: 0.9Keywords: triaged
Target Milestone: 3.0.0   
Hardware: PC   
OS: Linux   
See Also: https://git.eclipse.org/r/47871
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=cea378bd5d97851d3decfff5250841c00e601db3
Whiteboard:
Attachments:
Description Flags
BadLabelProvider none

Description Goulwen Le Fur CLA 2014-09-10 04:25:46 EDT
Sirius declare a weird labelProvider for DLine elements in the table representation. This declaration is done in the method 

  DTableElementSynchronizerSpec.getLabelProvider

This labelProvider try to use a registered ItemLabelProvider to define the text to display for the element of the line, otherwise it uses the toString() of this element.

The use of standard EMF itermProvider (like ReflectiveItemProvider) would be a better strategy for the second case.
Comment 1 Cedric Brun CLA 2014-09-10 04:37:05 EDT
BTW a pending ticket[1] which is about having Sirius operate in headless mode has an attached changeset which remove this labelprovider alltogether

https://git.eclipse.org/r/#/c/30652/

It would not fix your issue as the "toString" behavior is still here, nevertheless I though better to mention it as both patch are likely to collide in some way.

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=441554
Comment 2 Belqassim Djafer CLA 2015-01-26 04:45:59 EST
Currently working on it
Comment 3 Belqassim Djafer CLA 2015-01-29 08:20:19 EST
Proposed fix : https://git.eclipse.org/r/#/c/40439/
Comment 4 Belqassim Djafer CLA 2015-02-02 08:58:25 EST
Created attachment 250439 [details]
BadLabelProvider

To reproduce :
1- Import the Bug_443675, Bug_443675.edit and Bug_443675.editor projects in the workspace.
2- Delete itemProviderAdapterFactories extension in Bug_443675.edit and launch a runtime.
3- Import Bug_443675.design in the workspace (runtime environment).
4- Open "new Table" representation -> KO : bad label on all lines and no label on columns.
Comment 5 Belqassim Djafer CLA 2015-02-06 05:42:08 EST
Proposed fix : https://git.eclipse.org/r/#/c/40439/
Comment 6 Pierre-Charles David CLA 2015-02-06 06:08:17 EST
Fixed by 834450f0ea852703d67a03ea24893101f57519a4.
Comment 7 Belqassim Djafer CLA 2015-04-10 10:49:57 EDT
Verified on Sirius 3.0.0M6
Comment 8 Laurent Redor CLA 2015-05-13 11:37:58 EDT
Since the commit 834450f0ea852703d67a03ea24893101f57519a4 there is abusive dirty. At each table opening, the editor is dirty, even if there is no change.

The problem is in org.eclipse.sirius.table.business.internal.refresh.DTableElementSynchronizerSpec.setLabelWithFeatureValue(DCell, ColumnMapping, String). Since this commit, this method return false if the featureObject is null. It was not the case before.
Comment 9 Eclipse Genie CLA 2015-05-13 12:15:51 EDT
New Gerrit change created: https://git.eclipse.org/r/47871
Comment 11 Laurent Redor CLA 2015-05-18 05:37:02 EDT
Pb detected (comment 8) has been fixed with above commit (comment 10).
Comment 12 Pierre-Charles David CLA 2015-05-22 09:08:05 EDT
Verified on Sirius 3.0.0rc1a.
Comment 13 Pierre-Charles David CLA 2015-06-24 11:16:34 EDT
Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0.