This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 104134

Summary: Add option to "Handler for ..." dialog to select event handler
Product: guibuilder Reporter: dmiller <dmiller>
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: blocker    
Priority: P3    
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: Proposal for org.netbeans.modules.form.EventCustomEditor

Description dmiller 2007-05-17 04:54:33 UTC
When defining an event handler, the button in the properties panel displays the
"Handler for <eventname>" dialog. Currently this give you the option of adding,
removing, or renaming a handler. 

Often there will be a handler that can be reused for multiple components. For
example, a focusGained handler for JTextFields that calls selectAll() to select
the contents of the field.

Currently the only way of reusing a handler is to select the value field in the
Properties dialog and type in the name to use. To the best of my knowledge,
there is no way to accomplish this through the "Handler for <eventname>" dialog;
only through the Properties dialog.

I propose either: adding a new "Select" button, or enhancing the "Add" button to
display a list of existing handlers bearing the correct signature. So, when
adding an actipnPerformed handler it would show all methods with the signature
void XXX(java.awt.event.ActionEvent YYY).

This would make it a lot easier than having to type in the name. In complex
forms you can wind up with a lot of these and picking from a list would be much
easier. Especially in light of the fact that when you are making the choice you
are in the Design view and cannot simply browse the code for the correct name
Comment 1 Tomas Pavek 2007-05-18 08:36:51 UTC
Maybe we could also change the combo in property sheet so it shows the 
available compatible handlers rather than showing the handlers attached to the 
event. Having multiple handlers attached to an event is less usual than using 
one handler for more components. The case of mutliple handlers to one event 
would be only handled by the dialog.
Comment 2 dmiller 2007-05-21 02:23:24 UTC
Created attachment 42583 [details]
Proposal for org.netbeans.modules.form.EventCustomEditor
Comment 3 dmiller 2007-05-21 02:27:41 UTC
How about this for the event custom editor: attachment 42583 [details]