changeset 7211:d1538beb0d93

Merge
author coffeys
date Tue, 13 May 2014 12:21:28 -0700
parents 3c95ffb5e81f 4645fadf8352
children 0f17bd8d91eb
files
diffstat 4 files changed, 19 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri May 09 04:24:44 2014 -0700
+++ b/.hgtags	Tue May 13 12:21:28 2014 -0700
@@ -420,3 +420,7 @@
 b06d4ed71ae0bc6e13f5a8437cb6388f17c66e84 jdk7u60-b13
 b7fbd9b4febf8961091fdf451d3da477602a8f1d jdk7u60-b14
 04882f9a073e8de153ec7ad32486569fd9a087ec jdk7u60-b15
+41547583c3a035c3924ffedfa8704e58d69e5c50 jdk7u60-b16
+e484202d9a4104840d758a21b2bba1250e766343 jdk7u60-b18
+e484202d9a4104840d758a21b2bba1250e766343 jdk7u60-b17
+7190843ddaf4f3ad158c3071be0f4ca42a5802dc jdk7u60-b19
--- a/src/share/classes/javax/swing/MenuSelectionManager.java	Fri May 09 04:24:44 2014 -0700
+++ b/src/share/classes/javax/swing/MenuSelectionManager.java	Tue May 13 12:21:28 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -30,6 +30,7 @@
 import javax.swing.event.*;
 
 import sun.awt.AppContext;
+import sun.swing.SwingUtilities2;
 
 /**
  * A MenuSelectionManager owns the selection in menu hierarchy.
@@ -60,6 +61,12 @@
             if (msm == null) {
                 msm = new MenuSelectionManager();
                 context.put(MENU_SELECTION_MANAGER_KEY, msm);
+
+                // installing additional listener if found in the AppContext
+                Object o = context.get(SwingUtilities2.MENU_SELECTION_MANAGER_LISTENER_KEY);
+                if (o != null && o instanceof ChangeListener) {
+                    msm.addChangeListener((ChangeListener) o);
+                }
             }
 
             return msm;
--- a/src/share/classes/sun/swing/SwingUtilities2.java	Fri May 09 04:24:44 2014 -0700
+++ b/src/share/classes/sun/swing/SwingUtilities2.java	Tue May 13 12:21:28 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2014, 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
@@ -80,6 +80,9 @@
     public static final Object LAF_STATE_KEY =
             new StringBuffer("LookAndFeel State");
 
+    public static final Object MENU_SELECTION_MANAGER_LISTENER_KEY =
+            new StringBuffer("MenuSelectionManager listener key");
+
     // Maintain a cache of CACHE_SIZE fonts and the left side bearing
      // of the characters falling into the range MIN_CHAR_INDEX to
      // MAX_CHAR_INDEX. The values in fontCache are created as needed.
--- a/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Fri May 09 04:24:44 2014 -0700
+++ b/test/javax/swing/text/StyledEditorKit/8016833/bug8016833.java	Tue May 13 12:21:28 2014 -0700
@@ -190,9 +190,9 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 3);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 4);
         // not too high
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) > 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) > 0);
     }
 
     void testStrikthrough() {
@@ -217,7 +217,7 @@
         // not too wide
         assertTrue(out3.getWidth() * 0.8 < out2.getWidth());
         // not too low
-        assertTrue(out3.getY() - (out1.getY() + out2.getHeight()) < 0);
+        assertTrue(out3.getY() - (out1.getY() + out2.getHeight() - 1) < 0);
         // not too high
         assertTrue(out3.getY() - out1.getY() > 1);
     }