589 if (l == null) {
590 return;
591 }
592 textListener = AWTEventMulticaster.remove(textListener, l);
593 }
594
595 /**
596 * Returns an array of all the text listeners
597 * registered on this text component.
598 *
599 * @return all of this text component's <code>TextListener</code>s
600 * or an empty array if no text
601 * listeners are currently registered
602 *
603 *
604 * @see #addTextListener
605 * @see #removeTextListener
606 * @since 1.4
607 */
608 public synchronized TextListener[] getTextListeners() {
609 return (TextListener[])(getListeners(TextListener.class));
610 }
611
612 /**
613 * Returns an array of all the objects currently registered
614 * as <code><em>Foo</em>Listener</code>s
615 * upon this <code>TextComponent</code>.
616 * <code><em>Foo</em>Listener</code>s are registered using the
617 * <code>add<em>Foo</em>Listener</code> method.
618 *
619 * <p>
620 * You can specify the <code>listenerType</code> argument
621 * with a class literal, such as
622 * <code><em>Foo</em>Listener.class</code>.
623 * For example, you can query a
624 * <code>TextComponent</code> <code>t</code>
625 * for its text listeners with the following code:
626 *
627 * <pre>TextListener[] tls = (TextListener[])(t.getListeners(TextListener.class));</pre>
628 *
629 * If no such listeners exist, this method returns an empty array.
|
589 if (l == null) {
590 return;
591 }
592 textListener = AWTEventMulticaster.remove(textListener, l);
593 }
594
595 /**
596 * Returns an array of all the text listeners
597 * registered on this text component.
598 *
599 * @return all of this text component's <code>TextListener</code>s
600 * or an empty array if no text
601 * listeners are currently registered
602 *
603 *
604 * @see #addTextListener
605 * @see #removeTextListener
606 * @since 1.4
607 */
608 public synchronized TextListener[] getTextListeners() {
609 return getListeners(TextListener.class);
610 }
611
612 /**
613 * Returns an array of all the objects currently registered
614 * as <code><em>Foo</em>Listener</code>s
615 * upon this <code>TextComponent</code>.
616 * <code><em>Foo</em>Listener</code>s are registered using the
617 * <code>add<em>Foo</em>Listener</code> method.
618 *
619 * <p>
620 * You can specify the <code>listenerType</code> argument
621 * with a class literal, such as
622 * <code><em>Foo</em>Listener.class</code>.
623 * For example, you can query a
624 * <code>TextComponent</code> <code>t</code>
625 * for its text listeners with the following code:
626 *
627 * <pre>TextListener[] tls = (TextListener[])(t.getListeners(TextListener.class));</pre>
628 *
629 * If no such listeners exist, this method returns an empty array.
|