When will "Create stub event handler methods named" be used?

Swing Designer allows you to quickly create the frames, panels, dialogs, applets and other UI elements that comprise Java Swing applications.

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

When will "Create stub event handler methods named" be used?

Postby mkornatzki » Fri Jul 24, 2009 12:47 am

Hi,

i was configuring the event handlers preferences for the designer and i didn't know when the options for "Create stub event handler methods named: " get used.
I enable "Create stub event handler methods named: " and select "do_${component_name}_${event_name}".

When i make a new action-performed event handler for a JTextfield then i get
private class StringValueField_2ActionListener implements ActionListener {

with the preference above i expected something linke
private class do_StringValueField_2_ActionListener implements ActionListener {

regards,
michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: When will "Create stub event handler methods named" be used?

Postby Eric Clayberg » Fri Jul 24, 2009 4:28 am

If you have the event coded generation configured to generate anonymous classes or to implement the listener interface on the parent class, that oiption will cause a method named do_StringValueField_2_actionPerformed() to be generated.

It has no effect on the name of an inner class used as an event handler. Class names should start with upper case letters in any case.
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

Re: When will "Create stub event handler methods named" be used?

Postby mkornatzki » Fri Jul 24, 2009 4:45 am

thanks. works great.

michael
mkornatzki
 
Posts: 121
Joined: Wed Oct 15, 2008 3:57 am

Re: When will "Create stub event handler methods named" be used?

Postby Eric Clayberg » Fri Jul 24, 2009 5:50 am

Glad that worked for you.
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 Swing Designer

Who is online

Users browsing this forum: No registered users and 1 guest