diff options
Diffstat (limited to 'libjava/java/awt/TextField.java')
-rw-r--r-- | libjava/java/awt/TextField.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/libjava/java/awt/TextField.java b/libjava/java/awt/TextField.java index 335edc6..c2c2be7 100644 --- a/libjava/java/awt/TextField.java +++ b/libjava/java/awt/TextField.java @@ -43,6 +43,7 @@ import java.awt.event.ActionListener; import java.awt.peer.TextFieldPeer; import java.awt.peer.TextComponentPeer; import java.awt.peer.ComponentPeer; +import java.util.EventListener; /** * This class implements a single line text entry field widget @@ -489,4 +490,32 @@ paramString() getEchoChar()); } + /** + * Returns an array of all the objects currently registered as FooListeners + * upon this <code>TextField</code>. FooListeners are registered using the + * addFooListener method. + * + * @exception ClassCastException If listenerType doesn't specify a class or + * interface that implements java.util.EventListener. + * + * @since 1.3 + */ + public EventListener[] getListeners (Class listenerType) + { + if (listenerType == ActionListener.class) + return AWTEventMulticaster.getListeners (action_listeners, listenerType); + + return super.getListeners (listenerType); + } + + /** + * Return all ActionListeners register to this <code>TextField</code> object + * as an array. + * + * @since 1.4 + */ + public ActionListener[] getActionListeners () + { + return (ActionListener[]) getListeners (ActionListener.class); + } } // class TextField |