Community
Participate
Working Groups
When comparing two Ecore files, both of whose EPackage.eClassifiers are alphabetically ordered, the order of differences does not preserve the eClassifiers ordering.
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.
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.
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.
(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.