8025126: [macosx] Invalid calls to setValueAt() within JTable in Java 7 on Mac OS X
Reviewed-by: serb
This commit is contained in:
parent
5f7b6dfb6c
commit
e04c087c6d
@ -949,7 +949,8 @@ public class LWWindowPeer
|
|||||||
KeyEvent keyEvent = new KeyEvent(focusOwner, id, when, modifiers,
|
KeyEvent keyEvent = new KeyEvent(focusOwner, id, when, modifiers,
|
||||||
keyCode, keyChar, keyLocation);
|
keyCode, keyChar, keyLocation);
|
||||||
AWTAccessor.getKeyEventAccessor().setExtendedKeyCode(keyEvent,
|
AWTAccessor.getKeyEventAccessor().setExtendedKeyCode(keyEvent,
|
||||||
ExtendedKeyCodes.getExtendedKeyCodeForChar(keyChar));
|
(keyChar == KeyEvent.CHAR_UNDEFINED) ? keyCode
|
||||||
|
: ExtendedKeyCodes.getExtendedKeyCodeForChar(keyChar));
|
||||||
postEvent(keyEvent);
|
postEvent(keyEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ import sun.awt.SunToolkit;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8007156
|
* @bug 8007156 8025126
|
||||||
* @summary Extended key code is not set for a key event
|
* @summary Extended key code is not set for a key event
|
||||||
* @author Alexandr Scherbatiy
|
* @author Alexandr Scherbatiy
|
||||||
* @run main ExtendedKeyCodeTest
|
* @run main ExtendedKeyCodeTest
|
||||||
@ -44,6 +44,7 @@ public class ExtendedKeyCodeTest {
|
|||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
|
SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit();
|
||||||
Robot robot = new Robot();
|
Robot robot = new Robot();
|
||||||
|
robot.setAutoDelay(50);
|
||||||
|
|
||||||
Frame frame = new Frame();
|
Frame frame = new Frame();
|
||||||
frame.setSize(300, 300);
|
frame.setSize(300, 300);
|
||||||
@ -54,14 +55,14 @@ public class ExtendedKeyCodeTest {
|
|||||||
public void keyPressed(KeyEvent e) {
|
public void keyPressed(KeyEvent e) {
|
||||||
eventsCount++;
|
eventsCount++;
|
||||||
setExtendedKeyCode = setExtendedKeyCode && (e.getExtendedKeyCode()
|
setExtendedKeyCode = setExtendedKeyCode && (e.getExtendedKeyCode()
|
||||||
== ExtendedKeyCodes.getExtendedKeyCodeForChar(e.getKeyChar()));
|
== ExtendedKeyCodes.getExtendedKeyCodeForChar(e.getKeyChar()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void keyReleased(KeyEvent e) {
|
public void keyReleased(KeyEvent e) {
|
||||||
eventsCount++;
|
eventsCount++;
|
||||||
setExtendedKeyCode = setExtendedKeyCode && (e.getExtendedKeyCode()
|
setExtendedKeyCode = setExtendedKeyCode && (e.getExtendedKeyCode()
|
||||||
== ExtendedKeyCodes.getExtendedKeyCodeForChar(e.getKeyChar()));
|
== ExtendedKeyCodes.getExtendedKeyCodeForChar(e.getKeyChar()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -77,5 +78,29 @@ public class ExtendedKeyCodeTest {
|
|||||||
if (eventsCount != 2 || !setExtendedKeyCode) {
|
if (eventsCount != 2 || !setExtendedKeyCode) {
|
||||||
throw new RuntimeException("Wrong extended key code");
|
throw new RuntimeException("Wrong extended key code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frame = new Frame();
|
||||||
|
frame.setSize(300, 300);
|
||||||
|
setExtendedKeyCode = false;
|
||||||
|
|
||||||
|
frame.addKeyListener(new KeyAdapter() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void keyPressed(KeyEvent e) {
|
||||||
|
setExtendedKeyCode = e.getExtendedKeyCode() == KeyEvent.VK_LEFT;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
frame.setVisible(true);
|
||||||
|
toolkit.realSync();
|
||||||
|
|
||||||
|
robot.keyPress(KeyEvent.VK_LEFT);
|
||||||
|
robot.keyRelease(KeyEvent.VK_LEFT);
|
||||||
|
toolkit.realSync();
|
||||||
|
frame.dispose();
|
||||||
|
|
||||||
|
if (!setExtendedKeyCode) {
|
||||||
|
throw new RuntimeException("Wrong extended key code!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user