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 - Add option to "Handler for ..." dialog to select event handler
Summary: Add option to "Handler for ..." dialog to select event handler
Status: NEW
Alias: None
Product: guibuilder
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@guibuilder
Depends on:
Reported: 2007-05-17 04:54 UTC by dmiller
Modified: 2008-05-05 15:51 UTC (History)
0 users

See Also:
Exception Reporter:

Proposal for org.netbeans.modules.form.EventCustomEditor (11.35 KB, image/png)
2007-05-21 02:23 UTC, dmiller

Note You need to log in before you can comment on or make changes to this bug.
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]