|Re: Enable the "export" of the diagram [message #219668 is a reply to message #219638]
||Sat, 21 February 2009 14:07
Originally posted by: cayla_sha.gmx.net|
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! ^^
Cristian Bertuccioli schrieb:
> 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.
Powered by FUDForum
. Page generated in 0.02439 seconds