Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Compare » CompareEditor with custom file format
CompareEditor with custom file format [message #1741178] Tue, 23 August 2016 14:20 Go to next message
Christian Beikov is currently offline Christian BeikovFriend
Messages: 7
Registered: May 2016
Junior Member
Hello,

I am new to Eclipse plugin development so excuse me if I am posting in the wrong forum or a noob question, but I couldn't find anything on the internet.

I have some models with a custom (non-XMI) serialization formats and I want to use EMFCompare to compare them.

What do I have to do to support these custom formats? I have serializers and deserializers for the Ecore models but I don't know how to integrate them.

I'd like to compare and also be able to merge models.

Thanks in advance!
Re: CompareEditor with custom file format [message #1741470 is a reply to message #1741178] Thu, 25 August 2016 12:43 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

If they are models you can use as EMF models, then EMF Compare should work from the get go (select both models and use compare with > each other). You might have to add your extension in the list EMF Compare knows about though. That's in the preferences (window > preferences) then "general" > "content types" and you'll see an "EMF Compare" entry on the right-hand side. You need to add yours there.

Laurent Goubet
Obeo
Re: CompareEditor with custom file format [message #1741471 is a reply to message #1741470] Thu, 25 August 2016 12:51 Go to previous messageGo to next message
Christian Beikov is currently offline Christian BeikovFriend
Messages: 7
Registered: May 2016
Junior Member
Thanks for the answer.
The thing is, I am using EMF Compare programmatically. The models I want to compare are from different versions in EGit sense.

I can open a compare editor if I provide the CompareEditorInput myself but I got no clue how I configre the saving of changes made to the model.

I was thinking maybe there is some adapter I could implement to serialize and deserialize EObjects and EMFCompare will just make use of that.
Re: CompareEditor with custom file format [message #1743968 is a reply to message #1741471] Wed, 21 September 2016 07:45 Go to previous messageGo to next message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

Sorry, I somehow missed your answer.

As for your question, EMF Compare only accepts EObjects or Resources as input, so your deserializers should actually be called before you even reach anything EMF Compare specific. Could you tell us how exactly it fails or what you didn't manage to do?

Laurent Goubet
Obeo
Re: CompareEditor with custom file format [message #1744917 is a reply to message #1743968] Sun, 02 October 2016 17:30 Go to previous messageGo to next message
Christian Beikov is currently offline Christian BeikovFriend
Messages: 7
Registered: May 2016
Junior Member
I am creating a ModelGitMergeEditorInput and passing that to CompareUI.openCompareEditor. Then I do some changes in the model in that editor and would like to save the changes to the model of my workspace. How do I do that?
Re: CompareEditor with custom file format [message #1745109 is a reply to message #1744917] Wed, 05 October 2016 09:46 Go to previous message
Laurent Goubet is currently offline Laurent GoubetFriend
Messages: 1902
Registered: July 2009
Senior Member
Hi,

I do not know exactly how the changes are reflected when you save an editor input, but there should be some kind of call back in there for the save operation (when you make changes in the editor, it should be marked as dirty and allow you to "save". You'll have to look at how the save action is actually implemented in there to hook into it.

Laurent Goubet
Obeo
Previous Topic:Elements matching order
Next Topic:Programmatically invoking a match engine
Goto Forum:
  


Current Time: Fri Mar 29 05:12:00 GMT 2024

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

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

Back to the top