<Swing Dev> [10] Review Request: JDK-6463710 : ListSelectionModel.setSelectionMode() underspecified
Semyon Sadetsky
semyon.sadetsky at oracle.com
Wed Sep 27 16:55:00 UTC 2017
Hi Pankaj,
Clearing current selection each time the selection mode is changed could
be a good solution for the issue but this may cause compatibility
problems in existing applications.
I'd suggest you try to preserve the consistent part of the current
selection, at least the topmost single row.
--Semyon
On 09/26/2017 11:17 PM, Pankaj Bansal wrote:
>
> Hi All,
>
> Please review the fix for JDK 10.
>
> Bug:
>
> https://bugs.openjdk.java.net/browse/JDK-6463710
>
> Webrev:
>
> http://cr.openjdk.java.net/~aghaisas/pankaj/6463710/webrev.00/
> <http://cr.openjdk.java.net/%7Eaghaisas/pankaj/6463710/webrev.00/>
>
> Issue:
>
> ListSelectionModel.setSelectionMode() or JList.setSelectionMode() does
> not change the selection and leaves the selection in inconsistent
> state. This bug will affect the JList and JTable as they both use
> ListSelectionModel. The JTree uses it indirectly through
> TreeSelectionModel which handles it.
>
> Fix:
>
> Made changes in ListSelectionModel to check if the selectionMode has
> changed and if yes, clear the selection.
>
> Made changes in JList to make it consistent with JTable.
>
> Added a test program to test the functionality for
> ListSelectionModel.setSelectionMode()
>
> Regards,
>
> Pankaj Bansal
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/swing-dev/attachments/20170927/f7184a74/attachment.html>
More information about the swing-dev
mailing list