Persisting WindowBuilder component properties as XML Elements in XWT [message #1446028] |
Thu, 16 October 2014 04:48  |
Eclipse User |
|
|
|
Hi all,
We are building a simple GUI based XML editor by extending the WindowBuilder XWT plugin. Essentially, controls are dragged on to the design page and are then converted to XWT by WindowBuilder. Up to now we've created a prototype version by extending the existing SWT controls (Composite, Label, Text) and adding new class members to them. These class members are then displayed as properties in the property view and are persisted as XML attributes of the respective control. The generated XWT looks something like this:
<p1:RootComponent xmlns:p1="clr-namespace:com.test.namespace" xmlns:x="http://www.eclipse.org/xwt" background="#E1E1E1" x:Name="RootName">
<p1:ControlComponent x:Name="Control1Name" customProperty1="some property" customProperty2="someproperty" />
</p1:RootComponent>
As you can see, this solution will not scale well and does not support complex class members. I.e. Members that are objects and not just strings. We'd ideally like WindowBuilder to write simple objects to XWT as elements of the control rather than as attributes, so that the end result looks something like the following:
<p1:RootComponent xmlns:p1="clr-namespace:com.test.namespace" xmlns:x="http://www.eclipse.org/xwt">
<p1:ControlComponent x:Name="Control1Name">
<CustomProperty1>
<Name></Name>
<Value></Value>
</CustomProperty1>
<CustomProperty2>
<Name></Name>
<Value></Value>
<SomethingElse></SomethingElse>
</CustomProperty2>
</p1:ControlComponent
</p1:RootComponent>
We've been able to get WindowBuilder to display custom PropertyEditors for objects, but the property is always written to XWT as an attribute of the control and not as an element.
Does anyone know how to get WindowBuilder to write objects to the XWT as elements? WindowBuilder documentation is very thin on the ground.
Many Thanks,
Simon
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02649 seconds