src/jdk.accessibility/share/classes/com/sun/java/accessibility/util/AccessibilityEventMonitor.java
changeset 52252 de9486d74a74
parent 47216 71c04702a3d5
equal deleted inserted replaced
52251:b43c2aa001a5 52252:de9486d74a74
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
   126          * upon the current topLevelWindows cached by EventQueueMonitor.
   126          * upon the current topLevelWindows cached by EventQueueMonitor.
   127          * @see EventQueueMonitor
   127          * @see EventQueueMonitor
   128          * @see AWTEventMonitor
   128          * @see AWTEventMonitor
   129          */
   129          */
   130         protected void installListeners() {
   130         protected void installListeners() {
   131             Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
   131             Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
   132             if (topLevelWindows != null) {
   132             if (topLevelWindows != null) {
   133                 for (int i = 0; i < topLevelWindows.length; i++) {
   133                 for (int i = 0; i < topLevelWindows.length; i++) {
   134                     if (topLevelWindows[i] instanceof Accessible) {
   134                     if (topLevelWindows[i] instanceof Accessible) {
   135                         installListeners((Accessible) topLevelWindows[i]);
   135                         installListeners((Accessible) topLevelWindows[i]);
   136                     }
   136                     }
   204          * upon the topLevelWindows cached by EventQueueMonitor.
   204          * upon the topLevelWindows cached by EventQueueMonitor.
   205          * @param eventID the event ID
   205          * @param eventID the event ID
   206          * @see EventID
   206          * @see EventID
   207          */
   207          */
   208         protected void removeListeners() {
   208         protected void removeListeners() {
   209             Window topLevelWindows[] = EventQueueMonitor.getTopLevelWindows();
   209             Window[] topLevelWindows = EventQueueMonitor.getTopLevelWindows();
   210             if (topLevelWindows != null) {
   210             if (topLevelWindows != null) {
   211                 for (int i = 0; i < topLevelWindows.length; i++) {
   211                 for (int i = 0; i < topLevelWindows.length; i++) {
   212                     if (topLevelWindows[i] instanceof Accessible) {
   212                     if (topLevelWindows[i] instanceof Accessible) {
   213                         removeListeners((Accessible) topLevelWindows[i]);
   213                         removeListeners((Accessible) topLevelWindows[i]);
   214                     }
   214                     }