提交 c7e57502 编写于 作者: A alexsch

8003978: closed/javax/swing/JRootPane/bug4670486.java fails since jdk7u12b01 on macosx

Reviewed-by: serb, leonidr
上级 ae091499
...@@ -787,7 +787,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel { ...@@ -787,7 +787,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
"List.font", new FontLazyValue(Region.LIST), "List.font", new FontLazyValue(Region.LIST),
"List.rendererUseUIBorder", Boolean.FALSE, "List.rendererUseUIBorder", Boolean.FALSE,
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
"Menu.arrowIcon", new GTKStyle.GTKLazyValue( "Menu.arrowIcon", new GTKStyle.GTKLazyValue(
"com.sun.java.swing.plaf.gtk.GTKIconFactory", "com.sun.java.swing.plaf.gtk.GTKIconFactory",
"getMenuArrowIcon"), "getMenuArrowIcon"),
......
...@@ -630,8 +630,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel ...@@ -630,8 +630,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel
"Menu.menuPopupOffsetY", new Integer(0), "Menu.menuPopupOffsetY", new Integer(0),
"Menu.submenuPopupOffsetX", new Integer(-2), "Menu.submenuPopupOffsetX", new Integer(-2),
"Menu.submenuPopupOffsetY", new Integer(3), "Menu.submenuPopupOffsetY", new Integer(3),
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK, "Menu.shortcutKeys", new int[]{
KeyEvent.META_MASK}, SwingUtilities2.getSystemMnemonicKeyMask(),
KeyEvent.META_MASK
},
"Menu.cancelMode", "hideMenuTree", "Menu.cancelMode", "hideMenuTree",
"MenuBar.border", menuBarBorder, "MenuBar.border", menuBarBorder,
......
...@@ -1153,7 +1153,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab ...@@ -1153,7 +1153,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
"Menu.menuPopupOffsetY", new Integer(0), "Menu.menuPopupOffsetY", new Integer(0),
"Menu.submenuPopupOffsetX", new Integer(0), "Menu.submenuPopupOffsetX", new Integer(0),
"Menu.submenuPopupOffsetY", new Integer(0), "Menu.submenuPopupOffsetY", new Integer(0),
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK}, "Menu.shortcutKeys", new int[]{
SwingUtilities2.getSystemMnemonicKeyMask()
},
"Menu.crossMenuMnemonic", Boolean.TRUE, "Menu.crossMenuMnemonic", Boolean.TRUE,
// Menu.cancelMode affects the cancel menu action behaviour; // Menu.cancelMode affects the cancel menu action behaviour;
// currently supports: // currently supports:
......
...@@ -1879,4 +1879,12 @@ public class SwingUtilities2 { ...@@ -1879,4 +1879,12 @@ public class SwingUtilities2 {
} }
return -1; return -1;
} }
public static int getSystemMnemonicKeyMask() {
Toolkit toolkit = Toolkit.getDefaultToolkit();
if (toolkit instanceof SunToolkit) {
return ((SunToolkit) toolkit).getFocusAcceleratorKeyMask();
}
return InputEvent.ALT_MASK;
}
} }
...@@ -36,6 +36,7 @@ import java.applet.Applet; ...@@ -36,6 +36,7 @@ import java.applet.Applet;
import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicBoolean;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import test.java.awt.regtesthelpers.Util; import test.java.awt.regtesthelpers.Util;
import sun.awt.OSInfo;
public class SubMenuShowTest extends Applet { public class SubMenuShowTest extends Applet {
Robot robot; Robot robot;
...@@ -86,6 +87,11 @@ public class SubMenuShowTest extends Applet { ...@@ -86,6 +87,11 @@ public class SubMenuShowTest extends Applet {
frame.setVisible(true); frame.setVisible(true);
Util.waitForIdle(robot); Util.waitForIdle(robot);
boolean isMacOSX = (OSInfo.getOSType() == OSInfo.OSType.MACOSX);
if (isMacOSX) {
robot.keyPress(KeyEvent.VK_CONTROL);
robot.delay(20);
}
robot.keyPress(KeyEvent.VK_ALT); robot.keyPress(KeyEvent.VK_ALT);
robot.delay(20); robot.delay(20);
robot.keyPress(KeyEvent.VK_F); robot.keyPress(KeyEvent.VK_F);
...@@ -93,6 +99,10 @@ public class SubMenuShowTest extends Applet { ...@@ -93,6 +99,10 @@ public class SubMenuShowTest extends Applet {
robot.keyRelease(KeyEvent.VK_F); robot.keyRelease(KeyEvent.VK_F);
robot.delay(20); robot.delay(20);
robot.keyRelease(KeyEvent.VK_ALT); robot.keyRelease(KeyEvent.VK_ALT);
if (isMacOSX) {
robot.keyRelease(KeyEvent.VK_CONTROL);
robot.delay(20);
}
Util.waitForIdle(robot); Util.waitForIdle(robot);
robot.keyPress(KeyEvent.VK_M); robot.keyPress(KeyEvent.VK_M);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册