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 69493 - A useful live template for firing events
Summary: A useful live template for firing events
Status: NEW
Alias: None
Product: java
Classification: Unclassified
Component: Editor (show other bugs)
Version: 5.x
Hardware: PC All
: P3 blocker (vote)
Assignee: Dusan Balek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-28 19:21 UTC by Tim Lebedkov
Modified: 2013-09-02 14:21 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Lebedkov 2005-11-28 19:21:07 UTC
${Foo}Event event = null;
Object[] listeners = ${listenerList
instanceof="javax.swing.event.EventListenerList"}.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -= 2) {
    if (listeners[i] == ${Foo}Listener.class) {
        if (event == null)
             event = new ${Foo}Event(this);
        ((${Foo}Listener) listeners[i + 1]).${method}(event);
    }
}