Containment reference in EMF Compare [message #1724451] |
Wed, 24 February 2016 04:16 |
Harish Goutham Messages: 1 Registered: February 2016 |
Junior Member |
|
|
Hi All,
For my use case, I have 2 mono-valued containment references that I have to show as a "CHANGE". From the following quote in the developers guide:
Quote:Second, any change in a containment reference, even if that reference is mono-valued, that represents a "new" element in the model is considered to be an addition. Note that this second case is an exception to the rule for change differences outlined below.
I deduce that any changes to the containment reference will be shown as "ADD" or "DELETE" and not a "CHANGE".
Tried to override protected void computeDifferences(Match match, EReference reference, boolean checkOrdering) in DefaultDiffEngine, this did not help.
If anybody can point out where I have to change the default implementation, it would be very helpful.
Thanks in advance.
Regards
Harish
|
|
|
Re: Containment reference in EMF Compare [message #1725279 is a reply to message #1724451] |
Wed, 02 March 2016 09:01 |
|
Hi Harish,
I wouldn't recommend customizing the change kind (add, delete, change, ...) in the diff, because this may have consequences when accepting/rejecting or merging the changes later. If you really just want to customize the way the diff is displayed in the comparison viewer, I'd suggest to customize the label provider.
Therefore, have a look at the extension point org.eclipse.emf.compare.edit.adapterFactory. With this extension point, you can register an adapterFactory for the type org.eclipse.emf.compare.provider.IItemStyledLabelProvider that returns a factory creating your customized subclass of org.eclipse.emf.compare.provider.spec.ReferenceChangeItemProviderSpec. In this subclass you would have to overwrite getStyledText(Object) and display "change" rather than add/delete in your scenario; in all other cases, just forward to the super implementation.
I hope this helps,
Philip
--
Philip Langer
Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
|
|
|
Powered by
FUDForum. Page generated in 0.03409 seconds