Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » "Save as" with multiple file formats
"Save as" with multiple file formats [message #640834] Tue, 23 November 2010 10:31 Go to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Howdy,

I have a data model that can be persisted in two different file formats - so far so good. At least for now, the two formats have different file extensions. So I simply created two extensions of org.eclipse.emf.ecore.extension_parser - so far so good. I also registered the same editor for both file extensions - this works.

My problem: I was hoping that I could switch from one file format to the other by opening the model in the editor, and then simply doing a "Save as" operation with the other file extension. But this doesn't work - it simply writes the model in the original format.

Before I start hacking something together I wanted to ask here for the "right" way to address this issue.

Thanks,

- Michael
Re: "Save as" with multiple file formats [message #640991 is a reply to message #640834] Tue, 23 November 2010 18:57 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33139
Registered: July 2009
Senior Member
Michael,

Comments below.

Michael Jastram wrote:
> Howdy,
>
> I have a data model that can be persisted in two different file
> formats - so far so good. At least for now, the two formats have
> different file extensions. So I simply created two extensions of
> org.eclipse.emf.ecore.extension_parser - so far so good. I also
> registered the same editor for both file extensions - this works.
>
> My problem: I was hoping that I could switch from one file format to
> the other by opening the model in the editor, and then simply doing a
> "Save as" operation with the other file extension. But this doesn't
> work - it simply writes the model in the original format.
>
> Before I start hacking something together I wanted to ask here for the
> "right" way to address this issue.
You can look at EcoreEditor to see how it deals with saves for *.emof
verses *.ecore, which represent two different formats for saving Ecore
instances.
>
> Thanks,
>
> - Michael


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: "Save as" with multiple file formats [message #641234 is a reply to message #640991] Wed, 24 November 2010 15:31 Go to previous message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Excellent - this was exactly what I was looking for. It just took me a few minutes to implement, and it works as intended. Thanks a lot.
Previous Topic:Nulling References
Next Topic:[Texo] IllegalArgumentException with example Identifiable
Goto Forum:
  


Current Time: Tue Apr 23 06:55:22 GMT 2024

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

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

Back to the top