Create and bind a GUI from xsd file automatically in eclipse rcp app
Asked Answered
M

1

15

I want to create GUI components from XSD files. The generated GUIs should be used for concrete xml instances of the corresponding schema with databinding to "interesting" elements or attributes content. I have considered these solutions:

  1. jaxfront. (commercial tool). This does not generate source code. This is important for me because I want communication between the generated GUIs and other components of the GUI.

  2. Use xsd2emf and try to generate an editor from that. The generated model is to complex, as well as the generated editor and it is buggy.

  3. Do it myself e.g. generate an xml from the xsd, load xml as dom, select the interessting parts and generate data binding using one method described at http://www.vogella.de/eclipse.html.

Has anyone another idea or already successfully solved that problem? I would prefer a free open source solution which generates a SWT GUI.

Mainstay answered 2/6, 2010 at 11:38 Comment(1)
I have found these useful link while making some research: - Generate Java Source From XML Schema (XSD) - Transforming XML Schemas into Java Swing GUIs - SwiXMLAhron
P
2

Have you looked at the Sapphire framework at eclipse?

With it you have to create a model based on a few simple java interface files with some annotations that would model your XSD. Then once you have the model defined, you create the SWT GUI with a single xml file (sdef file) that wires various property editors to your model. The property editors can be simple widgets like label, text, lists, combo boxes but also it can be complex editors like a GEF-based diagram editor. So basically if you have a few interfaces that describe your model, then can have a graphical editor for editing nodes in that model with less than 100 lines of XML.

See lines 22 to 121 of this sample file.

Participle answered 16/3, 2012 at 6:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.