|Re: Print differences to stdout [message #1022882 is a reply to message #1022091]
||Fri, 22 March 2013 18:03
| Olivier Constant
Registered: January 2012
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.
Powered by FUDForum
. Page generated in 0.08598 seconds