8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9

Reviewed-by: alexsch, serb
This commit is contained in:
Semyon Sadetsky 2015-10-28 13:54:43 +03:00
parent 57b304c9c4
commit 4140fd05a4
2 changed files with 32 additions and 24 deletions

View File

@ -324,23 +324,6 @@ public abstract class KeyboardFocusManager
"downCycleDefaultFocusTraversalKeys" "downCycleDefaultFocusTraversalKeys"
}; };
/**
* The default strokes for initializing the default focus traversal keys.
*/
private static final AWTKeyStroke[][] defaultFocusTraversalKeyStrokes = {
{
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0, false),
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK, false),
},
{
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK, false),
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK | InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK,
false),
},
{},
{},
};
/** /**
* The default focus traversal keys. Each array of traversal keys will be * The default focus traversal keys. Each array of traversal keys will be
* in effect on all Windows that have no such array of their own explicitly * in effect on all Windows that have no such array of their own explicitly
@ -431,6 +414,27 @@ public abstract class KeyboardFocusManager
* Initializes a KeyboardFocusManager. * Initializes a KeyboardFocusManager.
*/ */
public KeyboardFocusManager() { public KeyboardFocusManager() {
AWTKeyStroke[][] defaultFocusTraversalKeyStrokes = {
{
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB, 0, false),
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
InputEvent.CTRL_DOWN_MASK |
InputEvent.CTRL_MASK, false),
},
{
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
InputEvent.SHIFT_DOWN_MASK |
InputEvent.SHIFT_MASK, false),
AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_TAB,
InputEvent.SHIFT_DOWN_MASK |
InputEvent.SHIFT_MASK |
InputEvent.CTRL_DOWN_MASK |
InputEvent.CTRL_MASK,
false),
},
{},
{},
};
for (int i = 0; i < TRAVERSAL_KEY_LENGTH; i++) { for (int i = 0; i < TRAVERSAL_KEY_LENGTH; i++) {
Set<AWTKeyStroke> work_set = new HashSet<>(); Set<AWTKeyStroke> work_set = new HashSet<>();
for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) { for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) {

View File

@ -42,8 +42,10 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl"); private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor = private static class KfmAccessor {
AWTAccessor.getKeyboardFocusManagerAccessor(); private static AWTAccessor.KeyboardFocusManagerAccessor instance =
AWTAccessor.getKeyboardFocusManagerAccessor();
}
// The constants are copied from java.awt.KeyboardFocusManager // The constants are copied from java.awt.KeyboardFocusManager
public static final int SNFH_FAILURE = 0; public static final int SNFH_FAILURE = 0;
@ -152,12 +154,13 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
long time, long time,
CausedFocusEvent.Cause cause) CausedFocusEvent.Cause cause)
{ {
return kfmAccessor.shouldNativelyFocusHeavyweight( return KfmAccessor.instance.shouldNativelyFocusHeavyweight(
heavyweight, descendant, temporary, focusedWindowChangeAllowed, time, cause); heavyweight, descendant, temporary, focusedWindowChangeAllowed,
time, cause);
} }
public static void removeLastFocusRequest(Component heavyweight) { public static void removeLastFocusRequest(Component heavyweight) {
kfmAccessor.removeLastFocusRequest(heavyweight); KfmAccessor.instance.removeLastFocusRequest(heavyweight);
} }
// WARNING: Don't call it on the Toolkit thread. // WARNING: Don't call it on the Toolkit thread.
@ -167,7 +170,8 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
boolean focusedWindowChangeAllowed, boolean focusedWindowChangeAllowed,
long time) long time)
{ {
return kfmAccessor.processSynchronousLightweightTransfer( return KfmAccessor.instance.processSynchronousLightweightTransfer(
heavyweight, descendant, temporary, focusedWindowChangeAllowed, time); heavyweight, descendant, temporary, focusedWindowChangeAllowed,
time);
} }
} }