8130895: Test javax/swing/system/6799345/TestShutdown.java fails on Solaris11 Sparcv9
Reviewed-by: alexsch, serb
This commit is contained in:
parent
57b304c9c4
commit
4140fd05a4
@ -324,23 +324,6 @@ public abstract class KeyboardFocusManager
|
||||
"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
|
||||
* 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.
|
||||
*/
|
||||
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++) {
|
||||
Set<AWTKeyStroke> work_set = new HashSet<>();
|
||||
for (int j = 0; j < defaultFocusTraversalKeyStrokes[i].length; j++) {
|
||||
|
@ -42,8 +42,10 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
|
||||
|
||||
private static final PlatformLogger focusLog = PlatformLogger.getLogger("sun.awt.focus.KeyboardFocusManagerPeerImpl");
|
||||
|
||||
private static AWTAccessor.KeyboardFocusManagerAccessor kfmAccessor =
|
||||
AWTAccessor.getKeyboardFocusManagerAccessor();
|
||||
private static class KfmAccessor {
|
||||
private static AWTAccessor.KeyboardFocusManagerAccessor instance =
|
||||
AWTAccessor.getKeyboardFocusManagerAccessor();
|
||||
}
|
||||
|
||||
// The constants are copied from java.awt.KeyboardFocusManager
|
||||
public static final int SNFH_FAILURE = 0;
|
||||
@ -152,12 +154,13 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
|
||||
long time,
|
||||
CausedFocusEvent.Cause cause)
|
||||
{
|
||||
return kfmAccessor.shouldNativelyFocusHeavyweight(
|
||||
heavyweight, descendant, temporary, focusedWindowChangeAllowed, time, cause);
|
||||
return KfmAccessor.instance.shouldNativelyFocusHeavyweight(
|
||||
heavyweight, descendant, temporary, focusedWindowChangeAllowed,
|
||||
time, cause);
|
||||
}
|
||||
|
||||
public static void removeLastFocusRequest(Component heavyweight) {
|
||||
kfmAccessor.removeLastFocusRequest(heavyweight);
|
||||
KfmAccessor.instance.removeLastFocusRequest(heavyweight);
|
||||
}
|
||||
|
||||
// WARNING: Don't call it on the Toolkit thread.
|
||||
@ -167,7 +170,8 @@ public abstract class KeyboardFocusManagerPeerImpl implements KeyboardFocusManag
|
||||
boolean focusedWindowChangeAllowed,
|
||||
long time)
|
||||
{
|
||||
return kfmAccessor.processSynchronousLightweightTransfer(
|
||||
heavyweight, descendant, temporary, focusedWindowChangeAllowed, time);
|
||||
return KfmAccessor.instance.processSynchronousLightweightTransfer(
|
||||
heavyweight, descendant, temporary, focusedWindowChangeAllowed,
|
||||
time);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user