RFR: 8360462: [macosx] row selection not working with Ctrl+Shift+Down/Up in AquaL&F [v3]

Abhishek Kumar abhiscxk at openjdk.org
Thu Jun 26 05:03:32 UTC 2025


On Thu, 26 Jun 2025 02:31:17 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

>> Ctrl+Shift+Down/Up does extend row selection down or up in Aqua L&F as it does in native tree view in Finder.
>> Fixed the keybindings.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fix

test/jdk/javax/swing/JTree/TestTreeRowSelection.java line 62:

> 60:                 frame.pack();
> 61:                 frame.setLocationRelativeTo(null);
> 62:                 frame.setVisible(true);

You may move UI implementation code to helper method.

test/jdk/javax/swing/JTree/TestTreeRowSelection.java line 67:

> 65:             robot.waitForIdle();
> 66:             robot.delay(1000);
> 67:             int selectedRowCount = tree.getSelectionCount();

`tree.getSelectionCount()` on EDT ?

test/jdk/javax/swing/JTree/TestTreeRowSelection.java line 82:

> 80:             System.out.println("rows selected " + curSelectedRowCount);
> 81:             if (curSelectedRowCount != selectedRowCount + 2) {
> 82:                 throw new RuntimeException("ctrl+shift+down not working");

Does it sound better ?
Suggestion:

                throw new RuntimeException("ctrl+shift+down does not select next row");

test/jdk/javax/swing/JTree/TestTreeRowSelection.java line 89:

> 87:             robot.keyRelease(KeyEvent.VK_UP);
> 88:             robot.keyRelease(KeyEvent.VK_SHIFT);
> 89:             robot.keyRelease(KeyEvent.VK_CONTROL);

Helper method can be used to perform robot operations.

test/jdk/javax/swing/JTree/TestTreeRowSelection.java line 95:

> 93:             System.out.println("rows selected " + curSelectedRowCount);
> 94:             if (curSelectedRowCount != selectedRowCount + 1) {
> 95:                 throw new RuntimeException("ctrl+shift+up not working");

Suggestion:

                throw new RuntimeException("ctrl+shift+up does not select previous row");

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25966#discussion_r2168104410
PR Review Comment: https://git.openjdk.org/jdk/pull/25966#discussion_r2168109502
PR Review Comment: https://git.openjdk.org/jdk/pull/25966#discussion_r2168107479
PR Review Comment: https://git.openjdk.org/jdk/pull/25966#discussion_r2168110873
PR Review Comment: https://git.openjdk.org/jdk/pull/25966#discussion_r2168107994


More information about the client-libs-dev mailing list