Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Group Differences
Group Differences [message #1765873] Wed, 14 June 2017 06:54 Go to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 54
Registered: March 2015
Member
Hello there,

i am using EMF Compare to compare two of my models and find differences between them. This works just fine.

Now i want to "Group" these differences, like the UI does this. How can i do this?

Example: I have two EMF Models that are equivalent. Then i add an EString-EAttribute (Named Foo) to the right model. Now i run the comparison and get 3 Changes:

eClassifier EString [java.lang.String] has been set
eType EString [java.lang.String] has been set
Foo : EString has been added to eStructuralFeatures

What i need is a representation that is only one difference saying "EAttribute "Foo" added to the right model". Exactly the same as the EMF Compare UI does it:

http://i.imgur.com/JjY3igF.png

How can i achieve this?

Thank you for your help.

Re: Group Differences [message #1765942 is a reply to message #1765873] Wed, 14 June 2017 14:27 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi Simon

I'm not sure I completely understand the question since, in the example you describe, there should only be 2 difference:
Quote:

eType EString [java.lang.String] has been set
Foo : EString has been added to eStructuralFeatures

The other one I don't know the origin of?

That being said, the UI uses filters to remove the first of these two, namely the "cascading differences" filter.

It sounds like you're not using the EMF Compare UI; are you trying to re-code one?

If you're using the default EMF Compare UI, you should have a look at the filters, they're extensible so you can add filters for your specific use cases if the cascading one doesn't meet your needs.
If you're trying to re-code an UI for the comparison, you might want to look at how we implemented filtering on the tree viewers, specifically, you want to look at org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.filters.StructureMergeViewerFilter and its uses.

This is kind of a scattershot answer, could you describe your use case a little more so that I might understand better what you're trying to achieve?

Laurent Goubet
Obeo
Re: Group Differences [message #1766411 is a reply to message #1765942] Wed, 21 June 2017 08:45 Go to previous messageGo to next message
Simon BBBBBBB is currently offline Simon BBBBBBBFriend
Messages: 54
Registered: March 2015
Member
Hallo Laurent, thank you for your reply.

i am developing an automatic merge-tool for our application. i need to merge all added elements from the left side to the right side, but i have to display these changes in an understandable way.

The first difference from my example comes from EMF compare. The reason i get this is because i use the FilterComparisonScope and not the DefaultComparisonScope. I have to do this because i need differences for EBoundTypes inside of ETypeParameters .

Thanks to your answer i found the CascadingDifferencesFilter wich does a part of what i need. Sadly its based on a tree viewer so i cant reuse it as it is. maybe i have to write my own filter
Re: Group Differences [message #1766501 is a reply to message #1766411] Thu, 22 June 2017 09:24 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1857
Registered: July 2009
Senior Member
Hi Simon,

Yes if you're displaying the differences without using the viewers provided by EMF Compare you will likely have to recode your own filter. The main class used for this is "ViewerFilter" from swt that can be applied to most viewers.

Do note that we are not happy with how the CascadingDifferencesFilter works (mainly because the filter, an UI mechanism, changes the way the merge, a core functionality, will handle differences). The mechanics underlying this are likely to change in the next version so that the "sub" differences are somehow recognizable through a link between them (for now, we don't really know how to represent that. Refinement maybe?). Please let us know of any input you might have on that and how you think this would be better described in the comparison model.

Laurent Goubet
Obeo
Previous Topic:EMFCompare and eclipse Che
Next Topic:NPE in ComparisonUtil.isContainedInFeatureMap
Goto Forum:
  


Current Time: Tue Jul 17 09:51:51 GMT 2018

Powered by FUDForum. Page generated in 0.02912 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top