Dynamically filled widget

GWT Designer allows you to quickly create the modules, composites, panels, remote services and other elements that comprise Google Web Tookit applications.

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

Dynamically filled widget

Postby ashouric » Sat Sep 30, 2006 9:35 pm

Dear all,

When designer loads a widget which is expected to be filled dynamically, it seems to parse whatever statements and try to 'view' them, but they are not indented to be used at design time.

I am not sure how to prevent this, but restricting parsing to constructor (or something like .NET InitializeComponent() ) might be considered.
ashouric
 
Posts: 75
Joined: Sat Sep 30, 2006 9:13 pm

Re: Dynamically filled widget

Postby Eric Clayberg » Sun Oct 01, 2006 5:03 am

ashouric wrote:When designer loads a widget which is expected to be filled dynamically, it seems to parse whatever statements and try to 'view' them, but they are not indented to be used at design time.

I am not sure how to prevent this, but restricting parsing to constructor (or something like .NET InitializeComponent() ) might be considered.

Custom widgets are not parsed. Their code is executed just as it is for any other component. That means that care must be taken to make sure that a custom componeht is design-time friendly. Often this can be handled will a null check specific to your application (e.g., check the value of an application global that will only be set at runtime).

The normal, approved way to do this in the Java world is to simply add a Beans.isDesignerTime() check to you code (that expression will return false at runtime and true at design time). Unfortunately, GWT does not yet support that construct so it does not work (yet).

Only the class being edited is actually parsed. You can hide code from the parser using code hiding tags.

Image
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 GWT Designer

Who is online

Users browsing this forum: No registered users and 3 guests