SWT bug and WB implementation

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

SWT bug and WB implementation

Postby domfe » Fri Nov 05, 2010 2:29 am

Hello.
I'm developing an SWT application and, during the layout process, the editor have warned me with
a message:

You are attempting to use a normal layout with a container that is within a
parent container using 'null' layout. Using 'null' layout in the parent will
prevent the child layouts from working due to a bug in SWT (in Designer you
will see the correct layout, but at runtime you will see empty containers). You
can use FormLayout in the parent, if you need a free form layout and want to
keep the child laytouts working. Do you want to use FormLayout in the parent
container?

And two button "Yes, use FormLayout" and "No, keep 'null' layout"

Can I have more information on this bug? Maybe a reference?
How can the Designer layout correctly the containers?

Thank you.
domfe
 
Posts: 46
Joined: Mon Oct 04, 2010 6:42 am

Re: SWT bug and WB implementation

Postby Eric Clayberg » Fri Nov 05, 2010 4:49 am

domfe wrote:Can I have more information on this bug?

The has been a feature of SWT since the very beginning. I think it is their subtle way of telling you never to use a null layout (which you never should).

If you have general questions about SWT itself, I would recommend asking them in the Eclipse SWT newsgroup.

domfe wrote:How can the Designer layout correctly the containers?

Designer can do anything it wants in its own design view since that is just a simulation.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: SWT bug and WB implementation

Postby domfe » Fri Nov 05, 2010 5:53 am

Thank you. Your answers confirm my thoughts.
I will avoid using null layouts.

Bye.
domfe
 
Posts: 46
Joined: Mon Oct 04, 2010 6:42 am

Re: SWT bug and WB implementation

Postby Eric Clayberg » Fri Nov 05, 2010 6:02 am

Yes. Null layouts are bad for many, many reasons.

The best layout to use in SWT is GridLayout. It is used for most layouts used everywhere in Eclipse itself
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA


Return to SWT Designer

Who is online

Users browsing this forum: Bing [Bot] and 1 guest

cron