Bug 412095 - EPackage.eClassifiers ordering ignored in display
Summary: EPackage.eClassifiers ordering ignored in display
Status: NEW
Alias: None
Product: EMFCompare
Classification: Modeling
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows Vista
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: EMF Compare CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-07-02 07:21 EDT by Ed Willink CLA
Modified: 2018-03-07 08:59 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2013-07-02 07:21:14 EDT
When comparing two Ecore files, both of whose EPackage.eClassifiers are alphabetically ordered, the order of differences does not preserve the eClassifiers ordering.
Comment 1 Laurent Goubet CLA 2013-07-02 07:36:26 EDT
Ed, the differences in the structure viewer mimic the structure of the compared models (as much as possible), but it is not the same model. On one side, a comparison model with differences detected -and stored- in an arbitrary order, on the other side your original models.

Is the "different" ordering you see on the top view (the structural viewer showing differences), or on the bottom views (the tree viewers showing the original models?

If it is on the top, there is no guarantee that the differences where detected in the order EMF "displays" the objects. And we cannot really do otherwise : the order of display is defined by the content providers, whereas we compare while iterating through the object references themselves. Therefore, the ordering of the "top" view is the ordering of our comparison elements' (Match/Diff) own content provider, not the content provider of the elements we actually detected differences on.
Comment 2 Ed Willink CLA 2013-07-02 08:26:35 EDT
It's the top view.

Internally no doubt you have have many difference sources, but when you determine a coherent UI presentation you can surely use the first source model to guide the ordering of the presentation.
Comment 3 Mikaël Barbero CLA 2013-07-16 05:40:44 EDT
Ed,

It surely would be nice to have such an enhancement to improve the display of the top panel (structure merge viewer). 

Currently, we have no time to do such a thing, but we would glad to help anyone interested by contributing such an improvement.

I'm changing this to enhancement.
Comment 4 Laurent Goubet CLA 2013-07-22 07:23:34 EDT
(In reply to comment #3)
> Currently, we have no time to do such a thing, but we would glad to help
> anyone interested by contributing such an improvement.

Marking the bug as such.

The ordering of an EObject's content is determined by that particular EObject's ItemProvider. Since we do not have the same EObject but instead a Diff referencing it, we cannot directly call the ItemProvider to order the Diffs. Furthermore, we do not show only EObjects in this view, but also plain Java objects such as DifferenceGroups. All displayed Objects are wrapped within an org.eclipse.emf.edit.tree.TreeNode.

Anyone interested in tackling this issue should look at org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.IDifferenceGroup.getGroupTree() which is in charge of actually creating the structure of all displayed items. Any re-ordering should likely take place there.