[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: Flat gui file editor question

"Alex Weirig" <alex.weirig@xxxxxxxxxxxxx> schrieb im Newsbeitrag
news:beun5h$aud$1@xxxxxxxxxxxxxx
> Hello,

hi alex,

> I want to create a file editor that offers the same look'n'feel as the
> plugin XML file editor.
>
> Although I can create the widgets with a FLAT look, I don't know how
> to create the "collapsable section titles" like "General Information"
> or "Runtime librairies" in the plugin editor.
>
> Is there any sample code available that explains how this can be
> achieved? Any help is welcome.
>

I am using the package org.eclipse.updates.ui.forms

I create a FormWidgetFactory
and create all my components with this factory like ... Composite composite
= factory.createComposite(parent and so on )....
That makes it looking FLAT and thats what eclipse is doing as well ...

Now to your Sections.
For a Section you have to extend the FormSection class that comes with the
package.
there you can set the section header, description and whether its
collabsable or not.
Than you have to implement the method createClient() which returns you the
Contents of your Section.
To add this section you do the following ...

ExampleSection section = new ExampleSection(parent, factory);
Control sectionControl = section.createControl(parent);

The createControl invokes the createClient method and adds the section to
your parent composite ...
Hope that helps..
Philipp
> TIA
>
> Alex
>