1.2.4b : Changing layout data variables

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.4b : Changing layout data variables

Postby cebarne2 » Thu Mar 11, 2004 9:04 am

This was also a bug in 1.2.3GA.

When I lay down a new control, a Text for example, I immediately tell it to span 4 columns.

Code: Select all
{
   final Text text = new Text(parent, SWT.BORDER);
   final GridData gridData = new GridData();
   gridData.horizontalSpan = 4;
   text.setLayoutData(gridData);
}


Then, I decide I want a better name for the GridData object. Using the designer, I change the name to "gdCommandFlags".

But, oops, it has just reset my hSpan property and the code still includes the old variable reference.

Code: Select all
{
   final Text text = new Text(parent, SWT.BORDER);
   final GridData gdCommandFlags = new GridData();
   >>error>>gridData.horizontalSpan = 4;<<error<<
   text.setLayoutData(gdCommandFlags);
}


Even after using the Designer to specify an hSpan of 4 again, the old reference still hangs around.

Code: Select all
{
   final Text text = new Text(parent, SWT.BORDER);
   final GridData gdCommandFlags = new GridData();
   gdCommandFlags.horizontalSpan = 4;
   >>error>>gridData.horizontalSpan = 4;<<error<<
   text.setLayoutData(gdCommandFlags);
}


I would expect renaming the GridData variable to perform a refactor instead of simply creating a new variable (and not even cleaning up after the old completely).

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

Re: 1.2.4b : Changing layout data variables

Postby Eric Clayberg » Mon Mar 15, 2004 6:15 am

cebarne2 wrote:I would expect renaming the GridData variable to perform a refactor instead of simply creating a new variable (and not even cleaning up after the old completely).

This should be fixed in the new v1.2.4 beta we released over the weekend.
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 miaomiao » Thu Apr 15, 2004 5:04 pm

It's easy;
you should delete old layout in the lestest inspecter,set a new layout ;
miaomiao
 
Posts: 4
Joined: Thu Apr 15, 2004 4:57 pm


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest