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 05:10 Go to next message
Felix Dorner is currently offline Felix Dorner
Messages: 206
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 14:03 Go to previous message
Olivier Constant is currently offline Olivier Constant
Messages: 38
Registered: January 2012
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: Mon Sep 01 03:51:36 EDT 2014

Powered by FUDForum. Page generated in 0.01782 seconds