Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » FormPage best practices
FormPage best practices [message #464520] Wed, 23 November 2005 17:24 Go to next message
Eclipse UserFriend
Originally posted by: offline.offlineblog.com

Hello;

I'm putting together a multi-page structure editor for an XML descriptor, and I'm interested in best practices for doing so.

Specifically, given that my editor is receiving as input the XML document, how should I arrange my classes (and data) in order to delegate bits of that document tree to pages etc.

Also, what is the best way to put widgets on the form? Not in terms of UI layout -- although that'd be great -- but rather, what combination of Sections, SectionParts, Composites, FormLayouts, and Widgets will result in the UI that I'm expecting (without specifying it precisely).

Any and all advice, code, and flat-out instructions are welcome.

Thank you.
Re: FormPage best practices [message #464539 is a reply to message #464520] Thu, 24 November 2005 07:55 Go to previous messageGo to next message
Daniel Rohe is currently offline Daniel RoheFriend
Messages: 63
Registered: July 2009
Member
For UI widgets look at the plugin org.eclipse.pde.ui. For attributes
maybe the classes in org.eclipse.pde.internal.ui.editor.plugin.rows
could help you.

Kind regards,
Daniel

Chris R schrieb:
> Hello;
>
> I'm putting together a multi-page structure editor for an XML descriptor, and I'm interested in best practices for doing so.
>
> Specifically, given that my editor is receiving as input the XML document, how should I arrange my classes (and data) in order to delegate bits of that document tree to pages etc.
>
> Also, what is the best way to put widgets on the form? Not in terms of UI layout -- although that'd be great -- but rather, what combination of Sections, SectionParts, Composites, FormLayouts, and Widgets will result in the UI that I'm expecting (without specifying it precisely).
>
> Any and all advice, code, and flat-out instructions are welcome.
>
> Thank you.
Re: FormPage best practices [message #464546 is a reply to message #464539] Thu, 24 November 2005 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: offline.offlineblog.com

That's kind of a start, but all I get out of that is that there's some value to having a large inheritance heirarchy of section widgets, but no idea of the <em>why</em> of it. There's no code documentation whatsoever, which makes it a bit challenging to glean any information about it from there.

What I'm looking for is something less in the way of "how does the code have to look" and more in the line of "how should the object heirarchy look, and why should it look that way?"
Re: FormPage best practices [message #464556 is a reply to message #464546] Thu, 24 November 2005 18:04 Go to previous messageGo to next message
Daniel Rohe is currently offline Daniel RoheFriend
Messages: 63
Registered: July 2009
Member
Chris R schrieb:
> That's kind of a start, but all I get out of that is that there's some value to having a large inheritance heirarchy of section widgets, but no idea of the <em>why</em> of it. There's no code documentation whatsoever, which makes it a bit challenging to glean any information about it from there.
>
> What I'm looking for is something less in the way of "how does the code have to look" and more in the line of "how should the object heirarchy look, and why should it look that way?"

First lets look at some small parts. You have XML elements that can
contain attributes. To display the attributes I think you should have
some kind of field, that knows the name, the type and the value of that
attribute. This field also manages the interaction with the XML element.
This means when the page or part is refreshed it must also refresh the
content of its widget with the content of the attribute. In the other
direction, if the user changes the content in the widget, the field must
commit this changes when the part or the pages must commit it's changes.
Because there are different kinds of attributes you should have fields
for strings (e.g. SWT Text), boolean values (e.g. combo boxes with
nothing, true and false or checkboxes with nothing, true or false),
enumerations (e.g. combo boxes), maybe strings that are handles as
resources or classes (SWT Text with a button to browse the current
classpath on the right), ...

example class hierarchy:
AttributeField <- TextField
(base class) <- BooleanField
<- ComboField (<- BooleanField)
<- ResourceField <- ClassField

When you have this the next greater element are the section parts. This
components I think should contain XML element specific data. They can
group together all attributes of a specific XML element. They can also
contain tables/trees or table-trees that display sub elements. To change
the sub elements you must provide some buttons, where the user can add,
edit or remove these elements. Buttons to add and remove a sub element
are mandatory. To edit a sub element you can also use cell modifier
instead of the button.

example class hierarchy:
MySectionPart <- DataSourceSection (attributes of an XML element)
(base class) <- SetPropertySection (table to display sub elements)
...

The next greater part are the pages. They also show the content of XML
elements. When these XML elements contain some kind of list of other XML
element it makes sense to use some kind of master/details layout of the
page. Because the master part then displays the list and the details
part displays the content of the currently selected XML element in the
master part. If the XML element has some other kind of structure you are
free to design the layout of the page. Here I think you should display
the most important data on the upper left. Because typically the user
reads from left to right and top to bottom.

MyEditorPage <- MyEditorMasterDetailsPage <- DataSourcesPage
(base class) <- ControllerPage
...

The editor than is a subclass of FormEditor. This I think is simple :-).

So far now, hope you could follow my thoughts.

Kind regards,
Daniel
Re: FormPage best practices [message #464562 is a reply to message #464556] Thu, 24 November 2005 20:31 Go to previous message
Eclipse UserFriend
Originally posted by: offline.offlineblog.com

Daniel, that looks like exactly the type of information I was looking for. I'll go over that with a fine-toothed comb and make something like it happen for me.

I hope it'll get me there ;)

Thank you!
Previous Topic:Refreshing View (Tableviewer)
Next Topic:Expandable Composite label (foreground) color
Goto Forum:
  


Current Time: Thu Apr 25 10:55:48 GMT 2024

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

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

Back to the top