On Fri, 16 Aug 2024 07:39:44 GMT, Tejesh R <t...@openjdk.org> wrote:

> In JTable, keyboard navigation keys Ctrl Shift RIGHT/LEFT doesn't follow 
> native actions of Linux. In native the actions are extended to end of 
> selected columns cells either LEFT/RIGHT but in swing gtk look and feel the 
> selection is extended to one cell to left/right. This might be taken as 
> reference of Windows OS since the same is observed in Windows native. Hence I 
> have update the actions for Ctrl Shift RIGHT & LEFT. 
> Added automated test too. The fix is tested in CI and its fine.

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 75:

> 73:             robot.delay(100);
> 74: 
> 75:             testCtrlShift(KeyEvent.VK_RIGHT, SELECTED_COLUMN, 
> table.getColumnCount()-1);

Suggestion:

            testCtrlShift(KeyEvent.VK_RIGHT, SELECTED_COLUMN, 
table.getColumnCount() - 1);

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 114:

> 112: 
> 113:         if (selectedColumnAfterKeyPress[0] != startCellCheck ||
> 114:                 
> selectedColumnAfterKeyPress[selectedColumnAfterKeyPress.length-1] !=

Suggestion:

                selectedColumnAfterKeyPress[selectedColumnAfterKeyPress.length 
- 1] !=

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 117:

> 115:                         endCellCheck) {
> 116:             System.out.println("Selected Columns: ");
> 117:             for (int columnAfterTabPress : selectedColumnAfterKeyPress) {

I don't think it is required to print the selected column.. If at all it is 
required for debugging I guess `columnAfterTabPress` should be renamed as 
columns are not selected after tab press.

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 120:

> 118:                 System.out.println(columnAfterTabPress);
> 119:             }
> 120:             String key = (keySelected == KeyEvent.VK_RIGHT)? "RIGHT" : 
> "LEFT";

"RIGHT" or "LEFT" can be passed as an argument to this method. This check can 
be removed.

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 122:

> 120:             String key = (keySelected == KeyEvent.VK_RIGHT)? "RIGHT" : 
> "LEFT";
> 121:             String failureMsg = "Test Failure. Failed to select cells 
> for Ctrl" +
> 122:                     " Shift "+key+" selection";

Suggestion:

                    " Shift " + key + " selection";

test/jdk/javax/swing/plaf/gtk/JTableCtrlShiftRightLeftKeyTest.java line 128:

> 126: 
> 127:     private static void createAndShowUI() {
> 128:         frame = new JFrame("Test JTable Tab Press");

Title should be changed to something like `Test JTable Ctrl + Shift + Left / 
Right Key Press`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719644278
PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719645093
PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719647618
PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719642247
PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719648412
PR Review Comment: https://git.openjdk.org/jdk/pull/20608#discussion_r1719649574

Reply via email to