Bug 60256 - DocumentListener's events not shown on Document's event wizard
Summary: DocumentListener's events not shown on Document's event wizard
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: VE (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Joe Winchester CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-28 10:59 EDT by Jeff Myers CLA
Modified: 2011-06-13 11:36 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Myers CLA 2004-04-28 10:59:19 EDT
Launching the event wizard on a Swing Document bean shows the document event
type on the tree, but no event methods under it.  There should be event methods
under the DocumentListener for changedUpdate, insertUpdate and removeUpdate. 
Note that the undoableEdit event type is shown properly on the same bean.

To recreate this problem:
Drop a JTextField.
Use the bean reference property editor on the document property to drop a new
PlainDocument object.
Select the PlainDocument object on the free form, MB2->Events->Add Events...
The document event type shown on the wizard does not have any event methods listed.
Comment 1 Joe Winchester CLA 2004-04-29 05:50:14 EDT
This actually looks like a Swing bug.  The problem is that the introspector 
just doesn't see the 3 methods on javax.swing.text.DocumentListener as being 
valid callback methods.  The reason is because their argument does not extend 
java.util.EventObject.
If you look at javax.swing.event.UndoableEditEvent this extends 
java.util.EventObject,
however javax.swing.event.Document event doesn't (it couldn't anyway because 
it is an interface)
The Introspector method that does the filtering check it:
 private boolean isEventHandler(Method m) throws IntrospectionException {
   // We assume that a method is an event handler if it has a single
   // argument, whose type inherit from java.util.Event

We need to log with this Sun, so I've sent Mark Davidson (the Sun BeanInfo 
developer) to see what he thinks