RFR: 6972078: Can not select single directory with GTKLookAndFeel [v4]

Abhishek Kumar abhiscxk at openjdk.org
Tue Nov 8 09:40:33 UTC 2022


On Fri, 4 Nov 2022 11:07:38 GMT, Abhishek Kumar <abhiscxk at openjdk.org> wrote:

>>> So, it is same without the fix too as is mentioned in that bug. 
>> 
>> Yeah, it behaves same without the fix also.
>
>> Can you please see why that is so as it should be exercising the same code path as this fix?
> 
> Ok, I will check.

> > Can you please see why that is so as it should be exercising the same code path as this fix?
>
> GTK FileChooser allows to select all folders in folder list but in files list it allows only single file selection. The reason behind this is while creating the GTKFileChooserUI, filelist selection model is set to `SINGLE_SELECTION` if **multiselection is disabled**. Code snippet is attached from `protected JScrollPane createFilesList()` method.
       
            if (getFileChooser().isMultiSelectionEnabled()) {
                      fileList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
            } else {
                      fileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            }
But for directory list there is no such condition is present and due to that it allows to select multiple folders in directory list with ctrl+A.

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

PR: https://git.openjdk.org/jdk/pull/10866



More information about the client-libs-dev mailing list