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

Bug 346733

Summary: Bug in TableLabelProvider : when the column is a FacetColumn the returned label is not correct
Product: z_Archived Reporter: Vincent Lorenzo <vincent.lorenzo>
Component: EMF-FacetAssignee: Gregoire Dupe <gdupe>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: Ed.Merks, emft.facet-inbox, fabien.giquel, gdupe
Version: unspecifiedFlags: gdupe: indigo+
Ed.Merks: pmc_approved+
gdupe: review+
fabien.giquel: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Bug Depends on:    
Bug Blocks: 334240    
Attachments:
Description Flags
This image illustrates the problem with a UML EnumerationLiteral (column "Importance")
none
Patch for Bug 346733
gdupe: iplog+
Patch for Bug 346733 Non regression test
none
Patch for Bug 346733 Non regression test gdupe: iplog+

Description Vincent Lorenzo CLA 2011-05-20 12:30:59 EDT
In the class TableLabelProvider, when the Column is a FacetColumn, you use the method queryResultToString(Object object) and in this method, you do object.toStirng() to get the string to display.  I think it is not the best solution, because often (like in my case), the returned element is an EObject (or a list of EObject), so you should call the method getTextFor(Object object) to get the label.
Comment 1 Vincent Lorenzo CLA 2011-05-24 03:10:32 EDT
Created attachment 196400 [details]
This image illustrates the problem with a UML EnumerationLiteral (column "Importance")

As we can see on this image, the text displayed for the EnumerationLiteral is not correct (it should be <EnumerationLiteral> High). The TableLabelProvider use the method toString instead of the method getTextFor(...) when the column is a Facet Column (Attribute and ReferenceFacet Column)
Comment 2 Gregoire Dupe CLA 2011-05-24 03:38:56 EDT
Hello,

To my mind, this problem of label display is major loss of function. That why I change the importance of this bug.

I hope that it would be possible to fix this bug for 0.1.0 RC2 or 0.1.0 RC3.

Regards,
Gregoire Dupe
Comment 3 Nicolas Guyomar CLA 2011-05-24 04:26:12 EDT
Created attachment 196407 [details]
Patch for Bug 346733

Hi,

Please find attached the necessary code modifications: getTextFor(Object object) is  now called to get the correct label for a ModelQueryResult in the TableLabelProvider.

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.
(d) This contribution contains no Cryptography features.

Regards,
Nicolas Guyomar
Comment 4 Nicolas Guyomar CLA 2011-05-26 03:06:41 EDT
Created attachment 196631 [details]
Patch for Bug 346733 Non regression test

Hi,

Please find attached a non regression test for this bug.

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.
(d) This contribution contains no Cryptography features.

Regards,
Nicolas Guyomar
Comment 5 Nicolas Guyomar CLA 2011-05-30 03:48:18 EDT
Created attachment 196871 [details]
Patch for Bug 346733 Non regression test

Hi,

Please find attached a non regression test using Ecore Metamodel instead of the UML one.

(a) I, Nicolas Guyomar, wrote 100% of the code I've provided.
(b) I have the right to contribute the code to Eclipse.
(c) I contribute the content under the EPL.
(d) This contribution contains no Cryptography features.

Regards,
Nicolas Guyomar
Comment 6 Gregoire Dupe CLA 2011-05-30 04:52:41 EDT
Hello Ed and Fabien,

To my mind, this problem of label display is major loss of function. The path really is small: only 3 lines are modified and it does not break the unit tests.

Do you agree to commit the fix and the corresponding unit test?

Regard,
Grégoire
Comment 7 Gregoire Dupe CLA 2011-05-30 12:13:24 EDT
Comment on attachment 196407 [details]
Patch for Bug 346733

Here is a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 705.
Comment 8 Gregoire Dupe CLA 2011-05-30 12:13:44 EDT
Comment on attachment 196871 [details]
Patch for Bug 346733 Non regression test

Here is a contribution from one employee of Mia-Software, targeting future
Indigo release. The company has signed a Member Commiter Agreement. The
contribution does not need a CQ (see bug 322327).

I've committed this contribution.

Committed revision 705.
Comment 9 Gregoire Dupe CLA 2011-05-30 12:17:03 EDT
This bug can be mark as fixed.

Regards,
Gregoire
Comment 10 Gregoire Dupe CLA 2011-05-31 08:52:15 EDT
Comment on attachment 196407 [details]
Patch for Bug 346733

Hello,
My commit (revision 705) has been dropped. (I don’t understand why.) I’ve then re-commit this patch.

Committed revision 707.

Regards,
Gregoire Dupe
Comment 11 Gregoire Dupe CLA 2011-05-31 08:54:51 EDT
Comment on attachment 196871 [details]
Patch for Bug 346733 Non regression test

Hello,

My commit (revision 705) has been dropped. (I don’t understand why.) I’ve then re-committed this patch.

Committed revision 708.

Regards,
Gregoire Dupe
Comment 12 Vincent Lorenzo CLA 2011-06-09 05:01:27 EDT
This bug can be marked as closed.