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