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.
Summary: | InplaceEditor.add*Listener could throw TooManyListeners exception | ||
---|---|---|---|
Product: | platform | Reporter: | Jaroslav Tulach <jtulach> |
Component: | Explorer | Assignee: | _ tboudreau <tboudreau> |
Status: | VERIFIED WONTFIX | ||
Severity: | blocker | ||
Priority: | P2 | ||
Version: | 3.x | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 29447 |
Description
Jaroslav Tulach
2003-07-09 16:23:49 UTC
No it can't, that's a checked exception. Yes, it is checked exception, but I am not sure why that would clasify this issue as invalid. So once more. Please consider simplifying the life of InplaceEditor writers by declaring void InplaceEditor.addActionListener (ActionListener l) throws TooManyListenersException which properly expresses your desire to attach just one listener to each InplaceEditor and simplifies the life of writers in both cases: 1. if they inherit after JPanel (that does not have addActionListener method), they can simply write the code as described above with one field variable. 2. if they inherit from JTextField (has the addActionListener method and does not throw the exception) they do not need to do anything and it will still continue to work. Closing - not a terribly compelling argument, IMO. Compound components here are really the exception, not the rule, so 90% of the time it's fine. Also, there is no guarantee that a component, or worse (and more likely) a look and feel will not try to add its own action listener to the component, causing the exception to be thrown - people may see the throws argument and think they need to police it. There are equally effective ways to police listeners, such as clearing the listener list when clear() is called on the InplaceEditor. Simpler and safer to leave it as is. verifying. |