Compare commits

...

2 Commits
1993 ... 1419

Author SHA1 Message Date
Dmitry Batrak
529857d8c8 JBR-3307 First character is dropped when editing a table cell
(cherry picked from commit 2ccf6b65a7)
2021-04-14 14:14:10 +03:00
Dmitry Batrak
7ce18cfc17 JBR-3291 Input of characters using Alt+<NumPad> stopped working on Windows
(cherry picked from commit ba6b9c085e)
2021-04-14 14:07:43 +03:00
4 changed files with 10 additions and 16 deletions

View File

@@ -78,7 +78,7 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
private LinkedList<TypeAheadMarker> typeAheadMarkers = new LinkedList<TypeAheadMarker>();
private boolean consumeNextKeyTyped;
private Component restoreFocusTo;
private Component keyPressedComponent;
private WeakReference<Component> lastKeyPressedOrReleasedTarget = NULL_COMPONENT_WR;
private static boolean fxAppThreadIsDispatchThread;
@@ -1100,19 +1100,15 @@ public class DefaultKeyboardFocusManager extends KeyboardFocusManager {
if (((AWTEvent) ke).isPosted) {
Component focusOwner;
if (ke.getID() == KeyEvent.KEY_TYPED) {
focusOwner = keyPressedComponent;
focusOwner = lastKeyPressedOrReleasedTarget.get();
} else {
focusOwner = getFocusOwner();
if (focusOwner == null) {
focusOwner = getFocusedWindow();
}
lastKeyPressedOrReleasedTarget = new WeakReference<>(focusOwner);
}
ke.setSource(focusOwner);
if (ke.getID() == KeyEvent.KEY_PRESSED) {
keyPressedComponent = focusOwner;
} else if (ke.getID() == KeyEvent.KEY_RELEASED) {
keyPressedComponent = null;
}
}
if (ke.getSource() == null) {
return true;

View File

@@ -5266,7 +5266,6 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
// Start editing when a key is typed. UI classes can disable this behavior
// by setting the client property JTable.autoStartsEdit to Boolean.FALSE.
if (!retValue && condition == WHEN_ANCESTOR_OF_FOCUSED_COMPONENT &&
isFocusOwner() &&
!Boolean.FALSE.equals(getClientProperty("JTable.autoStartsEdit"))) {
// We do not have a binding for the event.
Component editorComponent = getEditorComponent();
@@ -5295,11 +5294,6 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
if (editorComponent == null) {
return false;
}
}
// If the editorComponent is a JComponent, pass the event to it.
if (editorComponent instanceof JComponent) {
retValue = ((JComponent)editorComponent).processKeyBinding
(ks, e, WHEN_FOCUSED, pressed);
// If we have started an editor as a result of the user
// pressing a key and the surrendersFocusOnKeystroke property
// is true, give the focus to the new editor.
@@ -5309,6 +5303,11 @@ public class JTable extends JComponent implements TableModelListener, Scrollable
editorComponent.requestFocus();
}
}
// If the editorComponent is a JComponent, pass the event to it.
if (editorComponent instanceof JComponent) {
retValue = ((JComponent)editorComponent).processKeyBinding
(ks, e, WHEN_FOCUSED, pressed);
}
}
return retValue;
}

View File

@@ -731,7 +731,7 @@ javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-al
javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all
javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all,macosx-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092 macosx-all
javax/swing/JComboBox/8057893/bug8057893.java 8169953 windows-all,macosx-all
javax/swing/JComboBox/8072767/bug8072767.java 8196093 windows-all,macosx-all
javax/swing/JComponent/4337267/bug4337267.java 8146451 windows-all

View File

@@ -885,8 +885,7 @@ javax/swing/JComboBox/6236162/bug6236162.java
javax/swing/JComboBox/6559152/bug6559152.java 8196090 windows-all,macosx-all,linux-all
javax/swing/JComboBox/6607130/bug6607130.java 8196091 windows-all
javax/swing/JComboBox/7031551/bug7031551.java 8199056 generic-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092 windows-all,macosx-all
javax/swing/JComboBox/8032878/bug8032878.java 8196439 macosx-all,windows-all,linux-all
javax/swing/JComboBox/8032878/bug8032878.java 8196092,8196439 macosx-all,linux-all
javax/swing/JComboBox/8033069/bug8033069NoScrollBar.java 8163367 macosx-all,windows-all,linux-all
javax/swing/JComboBox/8033069/bug8033069ScrollBar.java 8163367 generic-all
javax/swing/JComboBox/8041909/ActionListenerExceptionTest.java 8197552 macosx-all,windows-all,linux-all