Unknown Window Type

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

Unknown Window Type

Postby michael » Mon Feb 12, 2007 5:55 am

GWTDesigner works good for editing composites. However, if I need to extend something other than composite, GWTDesigner can't handle it. For example, I often need to extend SimplePanel instead of Composite so I can override the onBrowserEvent() method. Here's an example:

Code: Select all
package com.mycompany.mymodule.client;

import com.google.gwt.user.client.ui.SimplePanel;

public class TestPanel extends SimplePanel {

    public TestPanel() {
    }
}


Does GWTDesigner currently support editing widgets that are not composites? If not, is this planned functionality for an upcoming release?
-Michael
michael
 
Posts: 14
Joined: Tue Jan 23, 2007 9:06 am
Location: New Jersey

Re: Unknown Window Type

Postby Eric Clayberg » Mon Feb 12, 2007 10:39 am

michael wrote:if I need to extend something other than composite, GWTDesigner can't handle it.

Not so. GWT Designer currently supports editing EntryPoints, Composites, PopupPanels and DialogBoxes.

michael wrote:Does GWTDesigner currently support editing widgets that are not composites? If not, is this planned functionality for an upcoming release?

No and no.

As explicitly stated in the Google GWT docs on Creating Custom Widgets, the correct approach to creating a custom widget is to subclass Composite, not SimplePanel. If you must subclass SimplePanel, the subclass should be simple and contain no children (those should be added when the new panel is placed to a Composite).

We don't want to encourage bad design practice and support direct editing of panel subclasses. Widgets and panels are meant to be treated as atomic objects in the GUI builder. You may place them within the design view (as you can with your TestPanel example), but Designer is not a tool for creating them. If you want to create a custom widget composed of multiple atomic widgets, you should create a subclass of Composite as recommended by the GWT docs.

Designer already provided excellent support for doing this in the form of custom Composites. Not only can you place and edit widgets within a Composite using any panel type, you can also expose any widget or any widget property as a public property of the Composite. Designer also includes excellent support for visual inheritance so that you can create a hierarchy of custom components that inherit various visual elements from one another.
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

Postby michael » Mon Feb 12, 2007 1:59 pm

Eric, thanks for the response. My issue is that sinkEvents() doesn't work right for composites. That's why I'm stuck subclassing the panel. But I appreciate the response.
-Michael
michael
 
Posts: 14
Joined: Tue Jan 23, 2007 9:06 am
Location: New Jersey

Postby Eric Clayberg » Mon Feb 12, 2007 2:13 pm

michael wrote:Eric, thanks for the response. My issue is that sinkEvents() doesn't work right for composites. That's why I'm stuck subclassing the panel. But I appreciate the response.

You can subclass panel as long as you keep it simple. Don't add any children to it in the panel subclass. Add the new panel class to a Composite and then add widgets to the new panel within the composite.
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

Postby michael » Mon Feb 12, 2007 2:16 pm

Found a better workaround for this issue. Thanks again for the input Eric.
-Michael
michael
 
Posts: 14
Joined: Tue Jan 23, 2007 9:06 am
Location: New Jersey

Postby Eric Clayberg » Thu Feb 15, 2007 6:02 pm

michael wrote:Found a better workaround for this issue.

What was the work around, if I may ask?
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