GWT Designer don't support the other Panel that Composite ??

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

GWT Designer don't support the other Panel that Composite ??

Postby dialloma » Thu Jun 21, 2007 9:12 am

Hello,

There is my problem. It's about 3 days that I have purchass the GWTDesigner for GWT 1.3.3 but I think that this version doe'snt support all panels. For exemple if code by hand, I can create a class that extends the VerticalPanel, or HorizontalPanel etc....But with GWTDesigner, I think that we can't create directly a class that extends the previous Panels. We always a Composite class and within it We declared the Panel that we want to use. May be It's me that not understand the concept, but if it's possible I will glad to know how to do it.

Code: Select all
public class A extends VerticalPanel {
    .......................................
}
is not possible with GWTDesigner ?

My last question is in wich proportion can we estimation the saving of time if we use GWTDesigner instead the codage by hand ?

Thank you in advance and have a good afternoon
dialloma
dialloma
 
Posts: 2
Joined: Thu Jun 21, 2007 1:18 am

Re: GWT Designer don't support the other Panel that Composit

Postby Eric Clayberg » Thu Jun 21, 2007 2:28 pm

dialloma wrote:There is my problem. It's about 3 days that I have purchass the GWTDesigner for GWT 1.3.3 but I think that this version doe'snt support all panels. For exemple if code by hand, I can create a class that extends the VerticalPanel, or HorizontalPanel etc....But with GWTDesigner, I think that we can't create directly a class that extends the previous Panels. We always a Composite class and within it We declared the Panel that we want to use. May be It's me that not understand the concept, but if it's possible I will glad to know how to do it.

Code: Select all
public class A extends VerticalPanel {
    .......................................
}
is not possible with GWTDesigner ?

No. It is intentionally not possible.

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 VerticalPanel. If you must subclass VerticalPanel, 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 A 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.

dialloma wrote:My last question is in wich proportion can we estimation the saving of time if we use GWTDesigner instead the codage by hand ?

For the GUI portion of yoru application, you should be able to create your GUI 5-10 times faster than doing it by hand.
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 dialloma » Fri Jun 22, 2007 12:11 am

Hi Eric Clayberg,

I'm very glad to have your response. Thank you so much. So I have another question about the technical differencies between composite and others Panel. For example, are they a difference between those two followings approchs ?

1.

Code: Select all
public class A extends HorizontalPanel {
    public A(){
         this.add(new Button("Button"));
         this.add(new Label("Label"));
    }
}


2
Code: Select all
public class A extends Composite {
    public A(){
         final HorizontalPanel hpanel = new HorizontalPanel();

         hpanel.add(new Button("Button"));
         hpanel.add(new Label("Label"));
    }
}


The first code may be the code writing by hand and the second is generated by the designer. I assume that those two codes could not generat the same HTML and JavaScript codes.

Thank you in advance and have a good day
dialloma
dialloma
 
Posts: 2
Joined: Thu Jun 21, 2007 1:18 am

Postby Eric Clayberg » Fri Jun 22, 2007 4:41 am

dialloma wrote:are they a difference between those two followings approchs ?

No. Visually, they should look exactly the same when placed into another panel.

dialloma wrote:
Code: Select all
public class A extends Composite {
    public A(){
         final HorizontalPanel hpanel = new HorizontalPanel();

         hpanel.add(new Button("Button"));
         hpanel.add(new Label("Label"));
    }
}


That should be...
Code: Select all
public class A extends Composite {
    public A(){
         final HorizontalPanel hpanel = new HorizontalPanel();
         initWidget(hpanel);
         hpanel.add(new Button("Button"));
         hpanel.add(new Label("Label"));
    }
}

The initWidget(hpanel); is required.

dialloma wrote:The first code may be the code writing by hand and the second is generated by the designer.

Based on Google's own GWT guidelines, the second is how you should write code by hand as well. The first option should not be used at all.

dialloma wrote:I assume that those two codes could not generat the same HTML and JavaScript codes.

I have no idea. That would be a good question for Google.
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