A GWT designer created code question ...

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

A GWT designer created code question ...

Postby bpetro » Fri Jun 12, 2009 12:01 pm

This is probably a dumb question but I don't see any documentation right off on the GWT site... nor anywhere else ... of course its kinda hard to do searching on "{" and searching the words braces and brackets doesn't help so I'm stuck w/o knowing where else to look. SO ...

What is the purpose of and the logic behind breaking methods up into sections with opening and closing curly braces " { } "??
One thing I notice is that when creating a DockPanel you appear to "re-use" generic widget names as shown below. I notice that if I leave out the "curly brace sectioning" then the compiler (or eclipse) starts complaining about the name being redeclared ... can you give a quick review of the use and logic behind this?

Code: Select all
{
   HorizontalPanel horizontalPanel = new HorizontalPanel();
   horizontalPanel.setSize("100%", "60");
   dockPanel.add(horizontalPanel, DockPanel.NORTH);
}
{
   HorizontalPanel horizontalPanel = new HorizontalPanel();
   horizontalPanel .setSize("100%", "40");
   dockPanel.add(horizontalPanel, DockPanel.SOUTH);
}

Thanks!
bpetro
 
Posts: 12
Joined: Mon Jun 01, 2009 1:32 pm

Re: A GWT designer created code question ...

Postby Eric Clayberg » Fri Jun 12, 2009 12:09 pm

Nested block style is just one of the common code generation styles that GWT Designer supports.

It supports many other styles as well. Please see the docs.

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 2 guests