Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » Re: emf compare
Re: emf compare [message #129953] Sun, 05 October 2008 12:14 Go to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33133
Registered: July 2009
Senior Member
Silvio,

It's best to use the EMFT newsgroup to ask about compare. I've added it
to the "to" list of the reply.


Silvio wrote:
> I would like to display my compare results in a compare-editor /
> compare-view.
> As a test scenario i've used the ExampleLauncher.
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/tests/org.eclipse.emf.compare.tests/src /org/eclipse/emf/compare/tests/ExampleLauncher.java?root=Mod eling_Project&view=co
>
>
> I've read the org.eclipse.emf.compare api, but unfortunately I can't
> make head nor tail of it. :(
> I've tried sth. with ModelCompareEditorLauncher and
> ModelCompareEditorInput, but without any success.
> Do i need the org.eclipse.compare package for my purpose or is
> everything into org.eclipse.emf.compare i need ?
> Do you have an example implementation or some hints ?
>
> Thanks a lot!
>
> Cheers,
> Silvio


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: emf compare [message #129965 is a reply to message #129953] Mon, 06 October 2008 07:32 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060008040700000702080702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Thanks Ed ;)

Silvio,

I need to know how you're trying to use EMF Compare? The ExampleLauncher
on CVS should allow you to compare two models (if they can be loaded via
EMF). For dependencies, simply look at the README file (
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/examples/org.eclipse.emf.compare.exampl es.standalone/README?revision=1.1&root=Modeling_Project& amp;view=markup
) which lists the required libraries of this example.

If you're launching this code standalone, there is no way to load the
result in the compare editor, nor is there to display it in the compare
view.

If you're launching this code from within eclipse, you can display the
result in the editor by using a code as such :

ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
CompareUI.openCompareEditor(input);

with 'snapshot' being the result of the comparison as created in the
ExampleLauncher class.

cheers,

Laurent Goubet
Obeo


Ed Merks a
Re: emf compare [message #130026 is a reply to message #129965] Tue, 07 October 2008 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: tschappi.web.de

Hallo Laurent,

i am trying to launch this code from within eclipse, more concrete from within a unit-test.
I have a test-suite, which compares models with each other via EMF Compare.
If the test fails i would like to display the compare result with a compare editor.

Now, i tried running your code:

ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
CompareUI.openCompareEditor(input);

within my testCompose() method, alternatively within the tearDown() method, but nothing happens. No
editor opens, no error..nothing. The models i've compared are .ecore files and the snapshot-object
is not null. So, i've no idea whats wrong.


Another question, for what purpose do i need a ModelCompareEditorLauncher ?
It seems for me that it does the same thing CompareUI.openCompareEditor(input) does ?


- Silvio



> Thanks Ed ;)
>
> Silvio,
>
> I need to know how you're trying to use EMF Compare? The ExampleLauncher
> on CVS should allow you to compare two models (if they can be loaded via
> EMF). For dependencies, simply look at the README file (
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/examples/org.eclipse.emf.compare.exampl es.standalone/README?revision=1.1&root=Modeling_Project& amp;view=markup
> ) which lists the required libraries of this example.
>
> If you're launching this code standalone, there is no way to load the
> result in the compare editor, nor is there to display it in the compare
> view.
>
> If you're launching this code from within eclipse, you can display the
> result in the editor by using a code as such :
>
> ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
> CompareUI.openCompareEditor(input);
>
> with 'snapshot' being the result of the comparison as created in the
> ExampleLauncher class.
>
> cheers,
>
> Laurent Goubet
> Obeo
>
>
> Ed Merks a écrit :
>> Silvio,
>>
>> It's best to use the EMFT newsgroup to ask about compare. I've added
>> it to the "to" list of the reply.
>>
>>
>> Silvio wrote:
>>> I would like to display my compare results in a compare-editor /
>>> compare-view.
>>> As a test scenario i've used the ExampleLauncher.
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/tests/org.eclipse.emf.compare.tests/src /org/eclipse/emf/compare/tests/ExampleLauncher.java?root=Mod eling_Project&view=co
>>>
>>>
>>> I've read the org.eclipse.emf.compare api, but unfortunately I can't
>>> make head nor tail of it. :(
>>> I've tried sth. with ModelCompareEditorLauncher and
>>> ModelCompareEditorInput, but without any success.
>>> Do i need the org.eclipse.compare package for my purpose or is
>>> everything into org.eclipse.emf.compare i need ?
>>> Do you have an example implementation or some hints ?
>>>
>>> Thanks a lot!
>>>
>>> Cheers,
>>> Silvio
>
Re: emf compare [message #130037 is a reply to message #130026] Wed, 08 October 2008 08:11 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060201060304080804030005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Silvio,

The ModelCompareEditorLauncher's only purpose is to be used for the
extension point org.eclipse.ui.editors. It as no other use whatsoever
(well you can still use it to open the compare editor given the
workspace file but that doesn"t seem to be likely to happen).

The problem you're having might come from the fact you're trying to
launch it within a JUnit test : when launching "JUnit plug-in test", a
new runtime eclipse is launched to carry on the tests and an editor
would then be openened in this new eclipse, not in the development one.
Moreover, when the test completes the runtime eclipse (and all of its
editors) is closed without user interaction.

i don't know wether this "close all" behavior is the same when launching
"classic" JUnit tests.

Laurent Goubet
Obeo

Silvio a
Re: emf compare [message #620331 is a reply to message #129953] Mon, 06 October 2008 07:32 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060008040700000702080702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Thanks Ed ;)

Silvio,

I need to know how you're trying to use EMF Compare? The ExampleLauncher
on CVS should allow you to compare two models (if they can be loaded via
EMF). For dependencies, simply look at the README file (
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/examples/org.eclipse.emf.compare.exampl es.standalone/README?revision=1.1&root=Modeling_Project& amp;view=markup
) which lists the required libraries of this example.

If you're launching this code standalone, there is no way to load the
result in the compare editor, nor is there to display it in the compare
view.

If you're launching this code from within eclipse, you can display the
result in the editor by using a code as such :

ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
CompareUI.openCompareEditor(input);

with 'snapshot' being the result of the comparison as created in the
ExampleLauncher class.

cheers,

Laurent Goubet
Obeo


Ed Merks a
Re: emf compare [message #620336 is a reply to message #129965] Tue, 07 October 2008 14:55 Go to previous message
Eclipse UserFriend
Originally posted by: tschappi.web.de

Hallo Laurent,

i am trying to launch this code from within eclipse, more concrete from within a unit-test.
I have a test-suite, which compares models with each other via EMF Compare.
If the test fails i would like to display the compare result with a compare editor.

Now, i tried running your code:

ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
CompareUI.openCompareEditor(input);

within my testCompose() method, alternatively within the tearDown() method, but nothing happens. No
editor opens, no error..nothing. The models i've compared are .ecore files and the snapshot-object
is not null. So, i've no idea whats wrong.


Another question, for what purpose do i need a ModelCompareEditorLauncher ?
It seems for me that it does the same thing CompareUI.openCompareEditor(input) does ?


- Silvio



> Thanks Ed ;)
>
> Silvio,
>
> I need to know how you're trying to use EMF Compare? The ExampleLauncher
> on CVS should allow you to compare two models (if they can be loaded via
> EMF). For dependencies, simply look at the README file (
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/examples/org.eclipse.emf.compare.exampl es.standalone/README?revision=1.1&root=Modeling_Project& amp;view=markup
> ) which lists the required libraries of this example.
>
> If you're launching this code standalone, there is no way to load the
> result in the compare editor, nor is there to display it in the compare
> view.
>
> If you're launching this code from within eclipse, you can display the
> result in the editor by using a code as such :
>
> ModelCompareEditorInput input = new ModelCompareEditorInput(snapshot);
> CompareUI.openCompareEditor(input);
>
> with 'snapshot' being the result of the comparison as created in the
> ExampleLauncher class.
>
> cheers,
>
> Laurent Goubet
> Obeo
>
>
> Ed Merks a écrit :
>> Silvio,
>>
>> It's best to use the EMFT newsgroup to ask about compare. I've added
>> it to the "to" list of the reply.
>>
>>
>> Silvio wrote:
>>> I would like to display my compare results in a compare-editor /
>>> compare-view.
>>> As a test scenario i've used the ExampleLauncher.
>>> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.emf/org .eclipse.emf.compare/tests/org.eclipse.emf.compare.tests/src /org/eclipse/emf/compare/tests/ExampleLauncher.java?root=Mod eling_Project&view=co
>>>
>>>
>>> I've read the org.eclipse.emf.compare api, but unfortunately I can't
>>> make head nor tail of it. :(
>>> I've tried sth. with ModelCompareEditorLauncher and
>>> ModelCompareEditorInput, but without any success.
>>> Do i need the org.eclipse.compare package for my purpose or is
>>> everything into org.eclipse.emf.compare i need ?
>>> Do you have an example implementation or some hints ?
>>>
>>> Thanks a lot!
>>>
>>> Cheers,
>>> Silvio
>
Re: emf compare [message #620337 is a reply to message #130026] Wed, 08 October 2008 08:11 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------060201060304080804030005
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit

Silvio,

The ModelCompareEditorLauncher's only purpose is to be used for the
extension point org.eclipse.ui.editors. It as no other use whatsoever
(well you can still use it to open the compare editor given the
workspace file but that doesn"t seem to be likely to happen).

The problem you're having might come from the fact you're trying to
launch it within a JUnit test : when launching "JUnit plug-in test", a
new runtime eclipse is launched to carry on the tests and an editor
would then be openened in this new eclipse, not in the development one.
Moreover, when the test completes the runtime eclipse (and all of its
editors) is closed without user interaction.

i don't know wether this "close all" behavior is the same when launching
"classic" JUnit tests.

Laurent Goubet
Obeo

Silvio a
Previous Topic:Code generation from ant or maven
Next Topic:[Teneo] correct version for Eclipse 3.2.2 ??
Goto Forum:
  


Current Time: Thu Apr 18 03:33:06 GMT 2024

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

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

Back to the top