|How to attach itemproviders to EMF Compare UI? [message #1281175]
||Mon, 31 March 2014 09:20
| Anja Hansen
Registered: March 2014
I am comparing two files containing values in a setup described by a EMF model.
The values are loaded into the EMF model and the "runtime model" is given to EMF Compare. It works fine.
My question is how do I define an item provider (to provide customized icons, text labels and background colour) to the EMF Compare UI?
In our model an ItemProvider has been generated for each type in the model, but I would like to keep the item provider for the compare-view separate from the rest of the application's UI. This means that I want EMF Compare to stop looking at the standard item providers for the object type, and in stead use a compare-item-provider shared by most/all compared types.
I have not been able to find any user-examples of this in the documentation or unit tests, but I have found several references to various solutions, but none of them in enough detail that I have been able to reproduce them...
1. Should I use CompareConfiguration.setLabelProvider(ICompareInput, ICompareInputLabelProvider)? If so how do I get a compareInput? Can I get it from my Comparison or ??
2. Should I extend AdapterFactoryLabelProvider? If so, how do I connect this label provider or its adapter factory to the UI?
3. Should I extend CompareItemProviderAdapterFactorySpec and MatchItemProviderSpec as described in this old guide: https://wiki.eclipse.org/EMF_Compare/Specifications/ExtensionPointForAdapterFactories
But then again how do I connect the resulting itemprovider with the UI?
I'm working based on the sample code from the EMF Compare Developer Guide and How To Open Compare Dialog.
Powered by FUDForum
. Page generated in 0.01505 seconds