RFR: 4466930: JTable.selectAll boundary handling [v4]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Wed Mar 19 06:22:47 UTC 2025
On Wed, 19 Mar 2025 06:05:01 GMT, Tejesh R <tr at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Formatting
>
> src/java.desktop/share/classes/javax/swing/JTable.java line 2162:
>
>> 2160: }
>> 2161:
>> 2162: private void selectColumns(TableColumnModel columnModel, int columnCount) {
>
> Should we check whether column selection is allowed before selecting columns? Because by default only row selection is enabled.
No, as told earlier, selectAll selects all cells...
WHere do you see only row selection is enabled? In SwingSet2 JTable, if you do ctrl+A which is equivalent to selectAll, all cells gets selected..
> src/java.desktop/share/classes/javax/swing/JTable.java line 2188:
>
>> 2186: }
>> 2187: if (rowCount > 0 && columnCount > 0) {
>> 2188: selectRows(selectionModel, rowCount);
>
> Any reason for passing selectionModel(s) as parameters ? Anyhow they are class variables and can be used directly right ?
Yes, good catch..we need to use local variable as done in old code and not modify the class variables..Modified to store the instance variable in local and use that..
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24025#discussion_r2002496054
PR Review Comment: https://git.openjdk.org/jdk/pull/24025#discussion_r2002494510
More information about the client-libs-dev
mailing list