jdk/src/share/classes/sun/awt/AppContext.java
changeset 108 deaaed5cedb7
parent 2 90ce3da70b43
child 112 c7ed16a1bef2
equal deleted inserted replaced
107:ed0c7cfb3666 108:deaaed5cedb7
     1 /*
     1 /*
     2  * Copyright 1998-2007 Sun Microsystems, Inc.  All Rights Reserved.
     2  * Copyright 1998-2008 Sun Microsystems, Inc.  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.  Sun designates this
     7  * published by the Free Software Foundation.  Sun designates this
    38 import java.util.HashMap;
    38 import java.util.HashMap;
    39 import java.util.IdentityHashMap;
    39 import java.util.IdentityHashMap;
    40 import java.util.Map;
    40 import java.util.Map;
    41 import java.util.Set;
    41 import java.util.Set;
    42 import java.util.HashSet;
    42 import java.util.HashSet;
       
    43 import java.util.logging.Level;
       
    44 import java.util.logging.Logger;
    43 import java.beans.PropertyChangeSupport;
    45 import java.beans.PropertyChangeSupport;
    44 import java.beans.PropertyChangeListener;
    46 import java.beans.PropertyChangeListener;
    45 
    47 
    46 /**
    48 /**
    47  * The AppContext is a table referenced by ThreadGroup which stores
    49  * The AppContext is a table referenced by ThreadGroup which stores
   124  *
   126  *
   125  * @author  Thomas Ball
   127  * @author  Thomas Ball
   126  * @author  Fred Ecks
   128  * @author  Fred Ecks
   127  */
   129  */
   128 public final class AppContext {
   130 public final class AppContext {
       
   131     private static final Logger log = Logger.getLogger("sun.awt.AppContext");
   129 
   132 
   130     /* Since the contents of an AppContext are unique to each Java
   133     /* Since the contents of an AppContext are unique to each Java
   131      * session, this class should never be serialized. */
   134      * session, this class should never be serialized. */
   132 
   135 
   133     /* The key to put()/get() the Java EventQueue into/from the AppContext.
   136     /* The key to put()/get() the Java EventQueue into/from the AppContext.
   383 
   386 
   384         Runnable runnable = new Runnable() {
   387         Runnable runnable = new Runnable() {
   385             public void run() {
   388             public void run() {
   386                 Window[] windowsToDispose = Window.getOwnerlessWindows();
   389                 Window[] windowsToDispose = Window.getOwnerlessWindows();
   387                 for (Window w : windowsToDispose) {
   390                 for (Window w : windowsToDispose) {
   388                     w.dispose();
   391                     try {
       
   392                         w.dispose();
       
   393                     } catch (Throwable t) {
       
   394                         if (log.isLoggable(Level.FINER)) {
       
   395                             log.log(Level.FINER, "exception occured while disposing app context", t);
       
   396                         }
       
   397                     }
   389                 }
   398                 }
   390                 AccessController.doPrivileged(new PrivilegedAction() {
   399                 AccessController.doPrivileged(new PrivilegedAction() {
   391                         public Object run() {
   400                         public Object run() {
   392                             if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported())
   401                             if (!GraphicsEnvironment.isHeadless() && SystemTray.isSupported())
   393                             {
   402                             {