jdk/src/share/classes/java/awt/Dialog.java
changeset 15318 607db339afcc
parent 13652 42544e68dc39
child 16100 379f48d34516
equal deleted inserted replaced
15317:a5c7745e4127 15318:607db339afcc
  1045                     };
  1045                     };
  1046 
  1046 
  1047                     // if this dialog is toolkit-modal, the filter should be added
  1047                     // if this dialog is toolkit-modal, the filter should be added
  1048                     // to all EDTs (for all AppContexts)
  1048                     // to all EDTs (for all AppContexts)
  1049                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
  1049                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
  1050                         Iterator it = AppContext.getAppContexts().iterator();
  1050                         Iterator<AppContext> it = AppContext.getAppContexts().iterator();
  1051                         while (it.hasNext()) {
  1051                         while (it.hasNext()) {
  1052                             AppContext appContext = (AppContext)it.next();
  1052                             AppContext appContext = it.next();
  1053                             if (appContext == showAppContext) {
  1053                             if (appContext == showAppContext) {
  1054                                 continue;
  1054                                 continue;
  1055                             }
  1055                             }
  1056                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
  1056                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
  1057                             // it may occur that EDT for appContext hasn't been started yet, so
  1057                             // it may occur that EDT for appContext hasn't been started yet, so
  1082                     }
  1082                     }
  1083 
  1083 
  1084                     // if this dialog is toolkit-modal, its filter must be removed
  1084                     // if this dialog is toolkit-modal, its filter must be removed
  1085                     // from all EDTs (for all AppContexts)
  1085                     // from all EDTs (for all AppContexts)
  1086                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
  1086                     if (modalityType == ModalityType.TOOLKIT_MODAL) {
  1087                         Iterator it = AppContext.getAppContexts().iterator();
  1087                         Iterator<AppContext> it = AppContext.getAppContexts().iterator();
  1088                         while (it.hasNext()) {
  1088                         while (it.hasNext()) {
  1089                             AppContext appContext = (AppContext)it.next();
  1089                             AppContext appContext = it.next();
  1090                             if (appContext == showAppContext) {
  1090                             if (appContext == showAppContext) {
  1091                                 continue;
  1091                                 continue;
  1092                             }
  1092                             }
  1093                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
  1093                             EventQueue eventQueue = (EventQueue)appContext.get(AppContext.EVENT_QUEUE_KEY);
  1094                             EventDispatchThread edt = eventQueue.getDispatchThread();
  1094                             EventDispatchThread edt = eventQueue.getDispatchThread();
  1394         IdentityArrayList<Dialog> blockers = new IdentityArrayList<Dialog>();
  1394         IdentityArrayList<Dialog> blockers = new IdentityArrayList<Dialog>();
  1395         for (Dialog d : modalDialogs) {
  1395         for (Dialog d : modalDialogs) {
  1396             if (d.shouldBlock(this)) {
  1396             if (d.shouldBlock(this)) {
  1397                 Window w = d;
  1397                 Window w = d;
  1398                 while ((w != null) && (w != this)) {
  1398                 while ((w != null) && (w != this)) {
  1399                     w = (Window)(w.getOwner_NoClientCode());
  1399                     w = w.getOwner_NoClientCode();
  1400                 }
  1400                 }
  1401                 if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
  1401                 if ((w == this) || !shouldBlock(d) || (modalityType.compareTo(d.getModalityType()) < 0)) {
  1402                     blockers.add(d);
  1402                     blockers.add(d);
  1403                 }
  1403                 }
  1404             }
  1404             }
  1609         // in 1.5 or earlier modalityType was absent, so use "modal" instead
  1609         // in 1.5 or earlier modalityType was absent, so use "modal" instead
  1610         if (modalityType == null) {
  1610         if (modalityType == null) {
  1611             setModal(modal);
  1611             setModal(modal);
  1612         }
  1612         }
  1613 
  1613 
  1614         blockedWindows = new IdentityArrayList();
  1614         blockedWindows = new IdentityArrayList<>();
  1615     }
  1615     }
  1616 
  1616 
  1617     /*
  1617     /*
  1618      * --- Accessibility Support ---
  1618      * --- Accessibility Support ---
  1619      *
  1619      *