MyEclipse Forums
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Richly
Post subject: Automatic Event code problems  PostPosted: Sep 27, 2006 - 04:04 AM
Registered Member
Registered Member


Joined: Sep 21, 2006
Posts: 41

When I add code for an event, e.g., ActionPerformed, from the Properties|Events, I click on <none> in the appropriate line, and then as soon as I press Enter, the source editor bounces around for a while (entertaining to watch...the first few times), highlights the new, automatically generated code and then scrolls to the bottom of the file, so I have to scroll up to find the highlighted code.

If I then decide to remove the code, I go back to the Properties|Events page, click on the ... on the ActionPerformed line, and select Remove from the form that pops up. Most -- but not all -- of the generated code will be removed. The remaining code, e.g.,
private void jButton1ActionPerformed(
generates a couple of errors when the class is saved. The same thing happens if I simply remove the name from the line by backspacing or clicking and pressing delete, i.e., without bringing up the form.

Best regards,
Richard
 
 View user's profile Send private message  
Reply with quote Back to top
support-rkalla
Post subject:   PostPosted: Sep 27, 2006 - 04:27 AM
Registered Member
Registered Member


Joined: Jan 06, 2004
Posts: 23824

Richard,
Thank you for the detailed report, I was able to reproduce the problems right away.

_________________
Riyad
MyEclipse Support
 
 View user's profile Send private message Visit poster's website  
Reply with quote Back to top
Richly
Post subject:   PostPosted: Sep 28, 2006 - 02:57 AM
Registered Member
Registered Member


Joined: Sep 21, 2006
Posts: 41

More in the same area: put a button onto a form, say jButton1, and click to add an ActionPerformed. Then change the name of the button to okButton. The result is not pretty! Go back to the Properties|Events. The name of the handler hasn't changed, but click on the ActionPerformed's ..., and on the pop-up you will see that the name of the handler has changed, so click OK. Then look at the source code: you'll see that jButton1ActionPerformed is still there, but there is now an error "The method okButtotnActionPerformed(ActionEvent) is undefined for the type new ActionListener(){}".

Best regards,
Richard
 
 View user's profile Send private message  
Reply with quote Back to top
Richly
Post subject:   PostPosted: Sep 28, 2006 - 03:01 AM
Registered Member
Registered Member


Joined: Sep 21, 2006
Posts: 41

P.S. Then delete the button from the form. You'd expect its handlers to go away, too. They don't.
 
 View user's profile Send private message  
Reply with quote Back to top
support-luc
Post subject:   PostPosted: Sep 29, 2006 - 04:43 PM
Registered Member
Registered Member


Joined: Jun 21, 2006
Posts: 19

The problems appears when some option of the Java code formatter are set. It appears the critical option is the one managing the position of the the opening brace for a method declaration.
A workaround is to use the default formatter settings, or at least set 'constructor declaration' to 'Same line' in the Brace tab.
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits