Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 21:53 Go to next message
Alfa Yohannis is currently offline Alfa YohannisFriend
Messages: 3
Registered: April 2018
Junior Member
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 22:09 Go to previous messageGo to next message
Alfa Yohannis is currently offline Alfa YohannisFriend
Messages: 3
Registered: April 2018
Junior Member
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 07:51 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1858
Registered: July 2009
Senior Member
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: Thu Sep 20 02:48:17 GMT 2018

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

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

Back to the top