< prev index next >

src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java

Print this page
rev 14722 : imported patch 8153362


  46 public class AccessibilityEventMonitor {
  47 
  48     // listeners
  49     /**
  50      * The current list of registered {@link java.beans.PropertyChangeListener
  51      * PropertyChangeListener} classes.
  52      *
  53      * @see #addPropertyChangeListener
  54      * @see #removePropertyChangeListener
  55      */
  56     static protected final AccessibilityListenerList listenerList =
  57         new AccessibilityListenerList();
  58 
  59 
  60     /**
  61      * The actual listener that is installed on the component instances.
  62      * This listener calls the other registered listeners when an event
  63      * occurs.  By doing things this way, the actual number of listeners
  64      * installed on a component instance is drastically reduced.
  65      */

  66     static protected final AccessibilityEventListener accessibilityListener =
  67         new AccessibilityEventListener();
  68 
  69     /**
  70      * Adds the specified listener to receive all PropertyChange events on
  71      * each UI object instance in the Java Virtual Machine as they occur.
  72      * <P>Note: This listener is automatically added to all component
  73      * instances created after this method is called.  In addition, it
  74      * is only added to UI object instances that support this listener type.
  75      *
  76      * @param l the listener to add
  77      *
  78      * @see #removePropertyChangeListener
  79      */
  80     static public void addPropertyChangeListener(PropertyChangeListener l) {
  81         if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
  82             accessibilityListener.installListeners();
  83         }
  84         listenerList.add(PropertyChangeListener.class, l);
  85     }




  46 public class AccessibilityEventMonitor {
  47 
  48     // listeners
  49     /**
  50      * The current list of registered {@link java.beans.PropertyChangeListener
  51      * PropertyChangeListener} classes.
  52      *
  53      * @see #addPropertyChangeListener
  54      * @see #removePropertyChangeListener
  55      */
  56     static protected final AccessibilityListenerList listenerList =
  57         new AccessibilityListenerList();
  58 
  59 
  60     /**
  61      * The actual listener that is installed on the component instances.
  62      * This listener calls the other registered listeners when an event
  63      * occurs.  By doing things this way, the actual number of listeners
  64      * installed on a component instance is drastically reduced.
  65      */
  66     @SuppressWarnings("unexportedinapi")
  67     static protected final AccessibilityEventListener accessibilityListener =
  68         new AccessibilityEventListener();
  69 
  70     /**
  71      * Adds the specified listener to receive all PropertyChange events on
  72      * each UI object instance in the Java Virtual Machine as they occur.
  73      * <P>Note: This listener is automatically added to all component
  74      * instances created after this method is called.  In addition, it
  75      * is only added to UI object instances that support this listener type.
  76      *
  77      * @param l the listener to add
  78      *
  79      * @see #removePropertyChangeListener
  80      */
  81     static public void addPropertyChangeListener(PropertyChangeListener l) {
  82         if (listenerList.getListenerCount(PropertyChangeListener.class) == 0) {
  83             accessibilityListener.installListeners();
  84         }
  85         listenerList.add(PropertyChangeListener.class, l);
  86     }


< prev index next >