[EMF Compare] Custom Diff Engine [message #1792392] |
Mon, 16 July 2018 17:53  |
Eclipse User |
|
|
|
Hello
I tried to a create a custom diff engine for the GUI / RCP EMF Compare. When debugging, I put a breakpoint at the beginning of each constructor or method to see if the extension really worked, but it turned out the execution never stopped at any of those breakpoints. The interesting part is that it always uses the DefaultDiffEngine. I put a breakpoint at the beginning of its constructor.
This is the custom diff engine class:
package mypackage.emfcompare;
import org.eclipse.emf.common.util.Monitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Match;
import org.eclipse.emf.compare.diff.DefaultDiffEngine;
import org.eclipse.emf.compare.diff.DiffBuilder;
import org.eclipse.emf.compare.diff.IDiffProcessor;
public class CustomDiffEngine extends DefaultDiffEngine {
public CustomDiffEngine() {
super(new DiffBuilder());
}
public CustomDiffEngine(IDiffProcessor iDiffProcessor) {
super(new DiffBuilder());
}
@Override
public void diff(Comparison comparison, Monitor monitor) {
super.diff(comparison, monitor);
}
@Override
protected void checkForDifferences(Match match, Monitor monitor) {
super.checkForDifferences(match, monitor);
}
}
And this is the extension configuration in the plugin.xml:
<plugin>
<extension
point="org.eclipse.emf.compare.rcp.diffEngine">
<descriptor
description="Custom DiffEngine"
id="CustomDiffEngine"
impl="mypackage.emfcompare.CustomDiffEngine"
label="CustomDiffEngine"
ranking="30">
</descriptor>
</extension>
...
I am wondering if this the correct way to extend diff engine for the GUI / RCP EMF Compare. Any suggestions?
Cheers,
Alfa
|
|
|
|
Re: [EMF Compare] Custom Diff Engine [message #1792716 is a reply to message #1792393] |
Mon, 23 July 2018 03:51  |
Eclipse User |
|
|
|
Hello,
For anyone else stumbling upon this question; the default engines for emf compare have a ranking 100, and the highest ranking engine is used by EMF Compare. Custom diff engines thus need a ranking higher than 100 to be used.
Laurent Goubet
Obeo
|
|
|
Powered by
FUDForum. Page generated in 0.03528 seconds