|
|
Re: create models to show in compare view [message #136934 is a reply to message #136536] |
Thu, 04 June 2009 14:59 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
|
This is a multi-part message in MIME format.
--------------020000050407010704080208
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi Thomas,
Sorry, I've been out of the office and couldn't check the newsgroup for
a while.
You should take a look at the
org.eclipse.emf.compare.examples.standalone example to see the necessary
code to compare two models and save the result in a readable emfdiff.
That said, the code would look something like :
----------8<----------
Map options = new HashMap();
// Matching
MatchModel match = MatchService.doMatch(resourceLeft, resourceRight,
options);
// Differencing
DiffModel diff = DiffService.doDiff(match);
// Create result instance
ComparisonResourceSnapshot snapshot =
DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
snapshot.setDate(Calendar.getInstance().getTime());
snapshot.setMatch(match);
snapshot.setDiff(diff);
// Save result
ModelUtils.save(snapshot, "result.emfdiff");
---------->8----------
Cheers,
Laurent Goubet
Obeo
Thomas L a
|
|
|
|
Re: create models to show in compare view [message #620993 is a reply to message #136536] |
Thu, 04 June 2009 14:59 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
|
This is a multi-part message in MIME format.
--------------020000050407010704080208
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 8bit
Hi Thomas,
Sorry, I've been out of the office and couldn't check the newsgroup for
a while.
You should take a look at the
org.eclipse.emf.compare.examples.standalone example to see the necessary
code to compare two models and save the result in a readable emfdiff.
That said, the code would look something like :
----------8<----------
Map options = new HashMap();
// Matching
MatchModel match = MatchService.doMatch(resourceLeft, resourceRight,
options);
// Differencing
DiffModel diff = DiffService.doDiff(match);
// Create result instance
ComparisonResourceSnapshot snapshot =
DiffFactory.eINSTANCE.createComparisonResourceSnapshot();
snapshot.setDate(Calendar.getInstance().getTime());
snapshot.setMatch(match);
snapshot.setDiff(diff);
// Save result
ModelUtils.save(snapshot, "result.emfdiff");
---------->8----------
Cheers,
Laurent Goubet
Obeo
Thomas L a
|
|
|
Powered by
FUDForum. Page generated in 0.04185 seconds