Preparing the input

The first thing to do is to choose an EMF Compare sub-implementation of the class of CompareEditorInput.

Two implementations are provided:

ComparisonEditorInput, that should be use when you want to display a pre-computed Comparison (the results of EMFCompare).

ComparisonScopeEditorInput, that should be use when you want to open the compare editor or dialog and to let it perform the comparison.

Both are available from the org.eclipse.emf.compare.ide.ui plug-in, in the package org.eclipse.emf.compare.ide.ui.internal.editor. This is still provisional API so we may break it any time.

Preparing the configuration

When instantiating an EMF Compare specific implementation of CompareEditorInput, you have to give it at least three paramaters:

a CompareConfiguration. This is a standard CompareConfiguration (no specific implementation needed) so you just instantiated it like this:

CompareConfiguration configuration =new CompareConfiguration();

an EMFCompareEditingDomain. It is not an implementation of EditingDomain from EMF. It shares similar concepts (it has a command stack, it can create some commands) but is much simpler. You can create it through the factory method:

Opening the compare UI

Then, you can call the black magic method from Eclipse Compare framework. You have two choices. You may either open the compare UI wihtin a modal dialog or within an editor. Just call one of the two following methods: