8003978: closed/javax/swing/JRootPane/bug4670486.java fails since jdk7u12b01 on macosx
Reviewed-by: serb, leonidr
This commit is contained in:
parent
73b452e941
commit
97013ba028
@ -787,7 +787,6 @@ public class GTKLookAndFeel extends SynthLookAndFeel {
|
||||
"List.font", new FontLazyValue(Region.LIST),
|
||||
"List.rendererUseUIBorder", Boolean.FALSE,
|
||||
|
||||
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK},
|
||||
"Menu.arrowIcon", new GTKStyle.GTKLazyValue(
|
||||
"com.sun.java.swing.plaf.gtk.GTKIconFactory",
|
||||
"getMenuArrowIcon"),
|
||||
|
@ -630,8 +630,10 @@ public class MotifLookAndFeel extends BasicLookAndFeel
|
||||
"Menu.menuPopupOffsetY", new Integer(0),
|
||||
"Menu.submenuPopupOffsetX", new Integer(-2),
|
||||
"Menu.submenuPopupOffsetY", new Integer(3),
|
||||
"Menu.shortcutKeys", new int[] {KeyEvent.ALT_MASK,
|
||||
KeyEvent.META_MASK},
|
||||
"Menu.shortcutKeys", new int[]{
|
||||
SwingUtilities2.getSystemMnemonicKeyMask(),
|
||||
KeyEvent.META_MASK
|
||||
},
|
||||
"Menu.cancelMode", "hideMenuTree",
|
||||
|
||||
"MenuBar.border", menuBarBorder,
|
||||
|
@ -1153,7 +1153,9 @@ public abstract class BasicLookAndFeel extends LookAndFeel implements Serializab
|
||||
"Menu.menuPopupOffsetY", new Integer(0),
|
||||
"Menu.submenuPopupOffsetX", 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.cancelMode affects the cancel menu action behaviour;
|
||||
// currently supports:
|
||||
|
@ -1879,4 +1879,12 @@ public class SwingUtilities2 {
|
||||
}
|
||||
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;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import test.java.awt.regtesthelpers.Util;
|
||||
import sun.awt.OSInfo;
|
||||
|
||||
public class SubMenuShowTest extends Applet {
|
||||
Robot robot;
|
||||
@ -86,6 +87,11 @@ public class SubMenuShowTest extends Applet {
|
||||
frame.setVisible(true);
|
||||
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.delay(20);
|
||||
robot.keyPress(KeyEvent.VK_F);
|
||||
@ -93,6 +99,10 @@ public class SubMenuShowTest extends Applet {
|
||||
robot.keyRelease(KeyEvent.VK_F);
|
||||
robot.delay(20);
|
||||
robot.keyRelease(KeyEvent.VK_ALT);
|
||||
if (isMacOSX) {
|
||||
robot.keyRelease(KeyEvent.VK_CONTROL);
|
||||
robot.delay(20);
|
||||
}
|
||||
Util.waitForIdle(robot);
|
||||
|
||||
robot.keyPress(KeyEvent.VK_M);
|
||||
|
Loading…
x
Reference in New Issue
Block a user