Skip to main content



      Home
Home » Modeling » Compare » [EMF Compare] Custom Diff Engine([EMF Compare] Custom Diff Engine)
[EMF Compare] Custom Diff Engine [message #1792392] Mon, 16 July 2018 17:53 Go to next message
Eclipse UserFriend
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 #1792393 is a reply to message #1792392] Mon, 16 July 2018 18:09 Go to previous messageGo to next message
Eclipse UserFriend
I already figured out how to solve this.
Thanks.
:)
Re: [EMF Compare] Custom Diff Engine [message #1792716 is a reply to message #1792393] Mon, 23 July 2018 03:51 Go to previous message
Eclipse UserFriend
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
Previous Topic:Model compare with files in SVN - RCP Application
Next Topic:Behavior of matcher
Goto Forum:
  


Current Time: Sun Aug 31 08:34:40 EDT 2025

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

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

Back to the top