< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/windows/DesktopProperty.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -27,10 +27,11 @@
import java.awt.*;
import java.beans.*;
import java.lang.ref.*;
import javax.swing.*;
import javax.swing.plaf.*;
+import sun.awt.AppContext;
/**
* Wrapper for a value from the desktop. The value is lazily looked up, and
* can be accessed using the <code>UIManager.ActiveValue</code> method
* <code>createValue</code>. If the underlying desktop property changes this
@@ -39,14 +40,12 @@
*
*/
// NOTE: Don't rely on this class staying in this location. It is likely
// to move to a different package in the future.
public class DesktopProperty implements UIDefaults.ActiveValue {
- /**
- * Indicates if an updateUI call is pending.
- */
- private static boolean updatePending;
+ public static final String DESKTOP_PROPERTY_UPDATE_PENDING_KEY =
+ "DesktopPropertyUpdatePending";
/**
* ReferenceQueue of unreferenced WeakPCLs.
*/
private static final ReferenceQueue<DesktopProperty> queue = new ReferenceQueue<DesktopProperty>();
@@ -84,18 +83,20 @@
/**
* Sets whether or not an updateUI call is pending.
*/
private static synchronized void setUpdatePending(boolean update) {
- updatePending = update;
+ AppContext.getAppContext()
+ .put(DESKTOP_PROPERTY_UPDATE_PENDING_KEY, update);
}
/**
* Returns true if a UI update is pending.
*/
private static synchronized boolean isUpdatePending() {
- return updatePending;
+ return Boolean.TRUE.equals(AppContext.getAppContext()
+ .get(DESKTOP_PROPERTY_UPDATE_PENDING_KEY));
}
/**
* Updates the UIs of all the known Frames.
*/
< prev index next >