Any easy way to set name for all widgets?

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

Any easy way to set name for all widgets?

Postby jasonwang » Thu Aug 09, 2007 8:59 pm

This is a requirement from testing team as WindowTester can easily locate a widget by using NamedWidgetLocator(). Of cause this can be done by adding a line such as widget.setData("Name","myName") or using SWT designer, but if there are hundreds of widgets need to be tested, then it is not applicable to ask developers to do that. So I would like to know if there is a way to assign a default name to each widget created by SWT designer.

Thanks.
jasonwang
 
Posts: 11
Joined: Tue Jul 17, 2007 10:51 pm

Re: Any easy way to set name for all widgets?

Postby Eric Clayberg » Fri Aug 10, 2007 3:58 am

jasonwang wrote:I would like to know if there is a way to assign a default name to each widget created by SWT designer.

Yes. You should turn on the Designer > Code Generation > Variable Names > Set variable name in widget data preference.

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 SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests