Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Enable the "export" of the diagram
Enable the "export" of the diagram [message #219638] Sat, 21 February 2009 11:12 Go to next message
Cristian is currently offline CristianFriend
Messages: 5
Registered: July 2009
Junior Member
Hi,

I want to know if is possible to enable an "export" feature that save
the instances of my model in a custom schema (preferably xml) instead of
the *.xxx and *.xxx_diagram files.

Or, alternatively, if is possible to change the behavior of the function
that "save" and "load" the instances of my model.


Regards,
Cristian
Re: Enable the "export" of the diagram [message #219668 is a reply to message #219638] Sat, 21 February 2009 14:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

Hello Cristian,

I do this in my editor: In my diagram I can right-click on my
*.xxx-file, choose Export, choose my own Export-Wizard and then the data
from the diagram is saved in two xml-files in my own xml-Format.

For that you need to build your own Wizard:
In the plugin.xml add the extension point "org.eclipse.ui.exportWizards".
Then I created 3 classes in ...diagram.part: An ExportWizard (extends
Wizard implements IExportWizard), an ExportPage (extends WizardPage) and
an ExportHandler (extends DefaultHandler).
On the ExportPage I ask the user for the file-paths (where he wants the
two xml-files). The Wizard starts the Page, takes the file-paths and
passes them to the Handler. The Handler is a SAX-Parser, which parses
the gmf-file and creates on-the-fly two new DOM-Trees. The Wizard takes
the ready DOM-Trees from the Handler, serializes them, puts them into
Files and saves them in the FileSystem.

Have fun! ^^
Best wishes
Julia


Cristian Bertuccioli schrieb:
> Hi,
>
> I want to know if is possible to enable an "export" feature that save
> the instances of my model in a custom schema (preferably xml) instead of
> the *.xxx and *.xxx_diagram files.
>
> Or, alternatively, if is possible to change the behavior of the function
> that "save" and "load" the instances of my model.
>
>
> Regards,
> Cristian
Re: Enable the "export" of the diagram [message #219731 is a reply to message #219638] Mon, 23 February 2009 15:37 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Cristian,

Try loading EMF model from this xml schema - as a result you'll have EMF
model saving/loading data just in accordance with the schema.

-----------------
Alex Shatalin
Previous Topic:Node Constraints
Next Topic:Show containment reference as tree in property sheet
Goto Forum:
  


Current Time: Fri Apr 26 06:31:26 GMT 2024

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

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

Back to the top