SUGGESTED FIX
Name: osR10079 Date: 03/21/2003
###@###.###, March 21, 2003
------- KeyboardFocusManager.java -------
*** /tmp/dcVaOGi Thu Mar 20 08:20:30 2003
--- KeyboardFocusManager.java Thu Mar 20 08:17:04 2003
***************
*** 164,189 ****
* @throws SecurityException if the calling thread does not have permission
* to replace the current KeyboardFocusManager
*/
! public synchronized static void setCurrentKeyboardFocusManager(
KeyboardFocusManager newManager) throws SecurityException
{
! AppContext appcontext = AppContext.getAppContext();
! if (newManager != null) {
! SecurityManager security = System.getSecurityManager();
! if (security != null) {
! if (replaceKeyboardFocusManagerPermission == null) {
! replaceKeyboardFocusManagerPermission =
! new AWTPermission("replaceKeyboardFocusManager");
! }
! security.
! checkPermission(replaceKeyboardFocusManagerPermission);
! }
! appcontext.put(KeyboardFocusManager.class, newManager);
! } else {
! appcontext.remove(KeyboardFocusManager.class);
}
}
/**
--- 164,207 ----
* @throws SecurityException if the calling thread does not have permission
* to replace the current KeyboardFocusManager
*/
! public static void setCurrentKeyboardFocusManager(
KeyboardFocusManager newManager) throws SecurityException
{
! SecurityManager security = System.getSecurityManager();
! if (security != null) {
! if (replaceKeyboardFocusManagerPermission == null) {
! replaceKeyboardFocusManagerPermission =
! new AWTPermission("replaceKeyboardFocusManager");
! }
! security.
! checkPermission(replaceKeyboardFocusManagerPermission);
! }
! KeyboardFocusManager oldManager = null;
! synchronized (KeyboardFocusManager.class) {
! AppContext appcontext = AppContext.getAppContext();
!
! if (newManager != null) {
! oldManager = getCurrentKeyboardFocusManager(appcontext);
!
! appcontext.put(KeyboardFocusManager.class, newManager);
! } else {
! oldManager = getCurrentKeyboardFocusManager(appcontext);
! appcontext.remove(KeyboardFocusManager.class);
! }
}
+
+ if (oldManager != null) {
+ oldManager.firePropertyChange("managingFocus",
+ Boolean.TRUE,
+ Boolean.FALSE);
+ }
+ if (newManager != null) {
+ newManager.firePropertyChange("managingFocus",
+ Boolean.FALSE,
+ Boolean.TRUE);
+ }
}
/**
***************
*** 1105,1110 ****
--- 1123,1131 ----
* registered for all bound properties of this class, including the
* following:
* <ul>
+ * <li>whether the KeyboardFocusManager is currently managing focus
+ * for this application or applet's browser context
+ * ("managingFocus")</li>
* <li>the focus owner ("focusOwner")</li>
* <li>the permanent focus owner ("permanentFocusOwner")</li>
* <li>the focused Window ("focusedWindow")</li>
***************
*** 1187,1192 ****
--- 1208,1216 ----
* property. The specified property may be user-defined, or one of the
* following:
* <ul>
+ * <li>whether the KeyboardFocusManager is currently managing focus
+ * for this application or applet's browser context
+ * ("managingFocus")</li>
* <li>the focus owner ("focusOwner")</li>
* <li>the permanent focus owner ("permanentFocusOwner")</li>
* <li>the focused Window ("focusedWindow")</li>
======================================================================
|