Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF Diff/Merge » Print differences to stdout
Print differences to stdout [message #1022091] Thu, 21 March 2013 09:10 Go to next message
Felix Dorner is currently offline Felix DornerFriend
Messages: 295
Registered: March 2012
Senior Member
Hi again Wink

Now that I have my list of IDifferences, is there a way to print them to stdout in a nice format? I can't use the UI unfortunately.

Cheers,
Felix
Re: Print differences to stdout [message #1022882 is a reply to message #1022091] Fri, 22 March 2013 18:03 Go to previous message
Olivier Constant is currently offline Olivier ConstantFriend
Messages: 106
Registered: January 2012
Senior Member
Hi again Felix,

There is no "standard" way of representing a difference textually. This is because depending on your context, you may need very different representations:
- relative to a given model in terms of additions/deletions/changes, or in an absolute way in terms of "present in this model but not in the other";
- as a flat list (OK for a short list or a technical log, but does not scale in terms of readability), or as a hierarchy driven by the model structure.

So you need to define your own label provider according to your representation context. However, you don't need to do it from scratch: you can use the facilities provided by DiffMergeLabelProvider. In particular, you may have a look at methods 'DiffMergeLabelProvider.getMatchText', 'DiffMergeLabelProvider.getDifferenceText' and 'IComparison.getContents'.

Also, since differences are technical you may want to expose only a subset to the user.

Olivier
Previous Topic:Ignore differences on attribute 'x' on elements of type 'y'
Next Topic:Most innovative feature/project award
Goto Forum:
  


Current Time: Thu Mar 28 12:18:43 GMT 2024

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

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

Back to the top