Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » Manipulating the EMF Compare Editor
Manipulating the EMF Compare Editor [message #1386379] Tue, 17 June 2014 08:48 Go to next message
Anja Hansen is currently offline Anja HansenFriend
Messages: 10
Registered: March 2014
Junior Member
Hi

We are looking into the possibilities of customizing the CompareUI editor.
CompareUI.openCompareEditor(input);


Q1:
Is it possible to inject the names of the files/models that we compare, so that they can be displayed in the two bottom windows?
Else it can be quite confusing to keep focus on which model is the changed one.
index.php/fa/18302/0/

Q2:
Can we make a filter that also affects the two bottom windows?
It would be nice to be able to see the differences side by side without having to view the full model.

Q3:
Can we remove/disable buttons in the tool bar e.g the merge icons.
We want to do this to ensure that our users don't use them by accident.

Q4:
Can we make the currently selected difference clearer by changing the color of the selection or by getting a thick line displayed between the changes.
The thick line is nicely displayed when comparing individual values, but not when displaying differences in the model.
index.php/fa/18303/0/
index.php/fa/18304/0/


It would be really nice if you added a description to the developers guide that describes which data elements/structures are used where in the UI.
A description on how to interpret the Comparison result will also be helpful IMO.
Re: Manipulating the EMF Compare Editor [message #1386407 is a reply to message #1386379] Tue, 17 June 2014 11:14 Go to previous messageGo to next message
Anja Hansen is currently offline Anja HansenFriend
Messages: 10
Registered: March 2014
Junior Member
I found the answer to Q3 on how to hide the merge buttons.
Call setLeft/RightEditable(false) on the configuration before it is passed to the editor input.

//Build the editor input
EMFCompareConfiguration configuration = new EMFCompareConfiguration(new CompareConfiguration()); 
configuration.setLeftEditable(false); //Disable merge buttons
configuration.setRightEditable(false);

ICompareEditingDomain editingDomain = EMFCompareEditingDomain.create(modelsToCompare.getChangedModel(), modelsToCompare.getReferenceModel(), null);
ComposedAdapterFactory adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
CompareEditorInput compareEditorInput = new ComparisonEditorInput(configuration, result, editingDomain, adapterFactory);
Re: Manipulating the EMF Compare Editor [message #1386964 is a reply to message #1386407] Mon, 23 June 2014 09:48 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi Anja,

Q1 : This has been recently fixed and the names are now displayed where you have orange text on your screenshot. IIRC, you can still alter them through the compareConfiguration (setLeftLabel, setRightLabel).

Q2 : No. We use the in-memory models loaded by EMF Compare and display them in a tree viewer, using the generated "edit" item and label providers for them.

Q3 : The merge buttons are only visible if the CompareConfiguration tells us that the models are editable. They won't be displayed if you call compareConfiguration.setLeftEditable(false) and compareConfiguration.setRightEditable(false). The other buttons of our toolbar are always displayed.

Q4 : You'll find some of our colors in General > Appearance > Colors and Fonts (EMF Compare category), but I don't think the colors you seek are available in there. You might want to look at CompareColorImpl, where all five colors IDs are defined (though these are intenal and subject to change), and manually change them to something of your liking. If that works, please raise an enhancement request on the bugzilla so that we can look at how to open an API or add these colors to the preferences. Something like this might do the trick :

IThemeManager themeManager = PlatformUI.getWorkbench().getThemeManager();
final ITheme currentTheme;
if (themeManager != null) {
	currentTheme = themeManager.getCurrentTheme();
	currentTheme.getColorRegistry().put(CompareColorImpl.INCOMING_CHANGE_COLOR_THEME_KEY, <RGB of your choice>);
}


Laurent Goubet
Obeo
Re: Manipulating the EMF Compare Editor [message #1707748 is a reply to message #1386964] Wed, 09 September 2015 06:14 Go to previous messageGo to next message
Vikhyat Prabhu is currently offline Vikhyat PrabhuFriend
Messages: 6
Registered: September 2015
Junior Member
Hi,

With respect to the Q2, is it possible to provide our own implementation for the item and label providers? We have a standard set of icons for our model elements throughout our application. So we want to customize the tree to show our icons instead of the default icons
Re: Manipulating the EMF Compare Editor [message #1708392 is a reply to message #1707748] Wed, 16 September 2015 08:22 Go to previous message
Philip Langer is currently offline Philip LangerFriend
Messages: 99
Registered: March 2015
Location: Vienna, Austria
Member

Hi Vikhyat,

Quote:
is it possible to provide our own implementation for the item and label providers?


Yes, you can use the extension point org.eclipse.emf.compare.edit.adapterFactory, which allows you to register custom providers. But the EMF Compare UI will automatically respect the providers that are registered through org.eclipse.emf.edit.itemProviderAdapterFactories, so it shouldn't be necessary in most of the scenarios . Maybe this thread will help too: https://www.eclipse.org/forums/index.php/t/681285/.

Best wishes,

Philip


--
Philip Langer

Get professional Eclipse developer support:
http://eclipsesource.com/en/services/developer-support/
Previous Topic:Support for Containment Proxies
Next Topic:Attribute changes in containment object result in ReferenceChange, but sometimes in AttributeChange
Goto Forum:
  


Current Time: Tue Mar 19 04:20:46 GMT 2024

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

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

Back to the top