Sneak Preview: New Code Generation Options

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Sneak Preview: New Code Generation Options

Postby Eric Clayberg » Wed Jan 21, 2004 2:08 pm

Many new code generation options are available now in the v1.2.4 beta of SWT Designer Professional.

Image

:arrow: Support for flat mode (e.g., create components within the same scope rather than in separate blocks)
:arrow: Prefix (separate) component creation with blank lines or custom comments
:arrow: Declare variables at the top of the method or where first assigned
:arrow: Optionally declare widget variables as final
:arrow: Share variables like "girdData", "formData", "label", "button", etc.
:arrow: Automatically create event handler stub methods

Comments? Suggestions?
Last edited by Eric Clayberg on Sat Feb 14, 2004 6:45 am, edited 2 times in total.
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 aspinei » Tue Jan 27, 2004 10:58 pm

It would be nice to be able to declare the variables as class attributes. Sometimes, common behavior is shared by different widgets via the same function in the class, which performs a specific action upon other widgets in the same composite.
It would also be interesting (altough harder to implement, I think) to be able to use custom widgets which simply inherit Canvas. As in Visual Studio, these widgets would be rendered by a grey box with the word "custom" inside it.
Kudos for a great product.
Adrian
aspinei
 
Posts: 4
Joined: Tue Jan 27, 2004 3:49 pm

Postby Eric Clayberg » Wed Jan 28, 2004 1:25 pm

aspinei wrote:It would be nice to be able to declare the variables as class attributes. Sometimes, common behavior is shared by different widgets via the same function in the class, which performs a specific action upon other widgets in the same composite.

Note that Designer does provide a toolbar button to convert widgets from local variables into fields. We also plan to add an additional code generation option to allow you to specify on a class by class basis which widget types should be declared as fields or local variables by default (i.e., have Labels created as local variables and Text widgets as fields). You woudl also be able to specify the default initial variable names for different types (like "gd" for GridData).

aspinei wrote:It would also be interesting (altough harder to implement, I think) to be able to use custom widgets which simply inherit Canvas. As in Visual Studio, these widgets would be rendered by a grey box with the word "custom" inside it.

Actually, you can do that now by dropping in a Canvas widget and then changing the class type in the source code. The Designer can support any subclass of a known type in this manner. Eventually, we want to add the ability to select and place a custom widget from within the editor or morph a widget into any subtype.
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 aspinei » Wed Jan 28, 2004 10:26 pm

Eric Clayberg wrote:We also plan to add an additional code generation option to allow you to specify on a class by class basis which widget types should be declared as fields or local variables by default (i.e., have Labels created as local variables and Text widgets as fields). You woudl also be able to specify the default initial variable names for different types (like "gd" for GridData).

That's excellent news !

aspinei wrote:Actually, you can do that now by dropping in a Canvas widget and then changing the class type in the source code.

I see, thank you for the tip.

Adrian
aspinei
 
Posts: 4
Joined: Tue Jan 27, 2004 3:49 pm

Postby pjchristopher » Wed Feb 04, 2004 10:22 am

When is this suppose to be released?
pjchristopher
 
Posts: 3
Joined: Wed Feb 04, 2004 9:34 am

Postby Eric Clayberg » Wed Feb 04, 2004 11:29 am

pjchristopher wrote:When is this suppose to be released?

We hope to start beta testing the new code generation features next week (once we are all back from EclipseCon :-)).
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 Hansz » Thu Feb 05, 2004 12:32 am

looking goooooooooooooood ... :D
Even the smallest person can change the course of the future - Galadriel
Hansz
 
Posts: 18
Joined: Thu Jan 15, 2004 12:45 am
Location: Hoofddorp, Netherlands

Postby Eric Clayberg » Sat Feb 14, 2004 6:43 am

Eric Clayberg wrote:
pjchristopher wrote:When is this suppose to be released?

We hope to start beta testing the new code generation features next week (once we are all back from EclipseCon :-)).

These features are now available in the new v1.2.4 beta.

Note that these new code generation options are brand new and are undergoing beta test during the 1.2.4 release cycle. Please report any anomalies to support@swt-designer.com. Also note that these new options apply to any new code that you create, not to existing code. If you have a window that was already laid out using block mode, these new options will not translate them. If you switch modes, you will get a mix of old style and new style in the same class as you add new widgets. We plan to add an option to automatically detect which code generation styles are in effect for a given window and have the Designer automatically adjust on a case by case basis (e.g., new windows would use the new settings, but existing windows would continue to use whatever settings were in effect when they were created.
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 SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest