Disappearing WindowBuilder Widgets & Objects in Google Web Toolkit

Google purchased and open-sourced WindowBuilder Pro late in 2010.  I’m using it as an Eclipse plugin to develop applications for Google Web Toolkit (GWT) and Google App Engine (GAE).  With WindowBuilder Pro, the developer can just drag & drop GUI elements (Widgets) into a Components Structure Panel in the Design window; another window in the IDE shows the resulting layout in real time.   The experience is similar to using MS Visual tools to develop a GUI.  By switching from the Design View to the Source View, the automatically-generated GUI source code can then be modified to add functionality.

Unfortunately, some source code modifications can cause the Design View to disappear, become uninterpretable, or only display fragments of the GUI layout.  In my case, authenticating User login via the Google loginService broke my WBPro design view:

LoginServiceAsync loginService = GWT.create(LoginService.class);
loginService.login(GWT.getHostPageBaseURL(), new AsyncCallback<LoginInfo>()
{
public void onFailure(Throwable error) {
Window.alert(“Login Failed:\n” + error.toString());
}
public void onSuccess(LoginInfo result)
{
loginInfo = result;
if(loginInfo.isLoggedIn()) {
initGUI();
}
else {
loadLogin();
}
}//onSuccess()
}); //loginService.login()

Why?  WBPro can’t (yet) parse dynamic GUI code based on runtime calculations

The code above, which uses Google loginService is dynamic; it won’t display the GUI unless the User is logged in.  My workaround for now?  Now that it’s debugged, I just commented out the loginService code block, and the Design View of my project magically reappeared.

It would be helpful if WindowBuilder Pro provided some feedback to the Developer when this happens – like a link to the FAQ – It would have saved me hours.

This entry was posted in Uncategorized and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *