1.2.3 beta: Renaming custom frame variable

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

1.2.3 beta: Renaming custom frame variable

Postby cebarne2 » Mon Jan 26, 2004 9:32 am

1) A tabfolder, tabitem, and scrolledComposite inside tabitem
2) Used a custom frame in the composite (SWT Frame wizard)
3) Renamed the frame variable from buildPaths to pgBuildPaths
-my Frame class is buildPaths and SWT Designer used that same name as the variable name
-I renamed it to avoid potential conflicts



After step #2:
Code: Select all
final buildPaths buildPaths = new buildPaths(scrolledComposite, SWT.NONE);
                  buildPaths.setSize(735, 303);
                  scrolledComposite.setContent(buildPaths);


After renaming in step #3:
Code: Select all
final pgBuildPaths pgBuildPaths = new pgBuildPaths(scrolledComposite, SWT.NONE);
                  pgBuildPaths.setSize(735, 303);
                  scrolledComposite.setContent(pgBuildPaths);


It seems that using a custom frame, it inherits the Frame's class as the variable name. Not good. Then, when I rename the variable via the control properties, it renames both the Class and instance names. This introduces an error in the code.

Regardless, I like this custom frame functionality.

Thanks
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA

Re: 1.2.3 beta: Renaming custom frame variable

Postby Eric Clayberg » Mon Jan 26, 2004 1:40 pm

cebarne2 wrote:1) A tabfolder, tabitem, and scrolledComposite inside tabitem
2) Used a custom frame in the composite (SWT Frame wizard)
3) Renamed the frame variable from buildPaths to pgBuildPaths
-my Frame class is buildPaths and SWT Designer used that same name as the variable name

Are you saying that your class name is "buildPaths" rather than "BuildPaths"? Shouldn't that class name be capitalized? The default variable name for a class is the class name with the first letter made lowercase. In this case, they would end up being the same thing. We will add some code to test for that case in the next update.
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 cebarne2 » Tue Jan 27, 2004 7:06 am

Yeah, looks like I screwed up a bit on the naming convention. But, it is only a convention. :wink:

Adding a check for this condition would only make the plug-in that much more robust.

Thank you for your consideration with this issue.
cebarne2
 
Posts: 67
Joined: Tue Sep 23, 2003 10:11 am
Location: Cedar Rapids, IA

Postby Eric Clayberg » Tue Jan 27, 2004 1:30 pm

cebarne2 wrote:Adding a check for this condition would only make the plug-in that much more robust.

A new v1.2.3 beta has been released that adds a check for this condition.
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