JDK-8210210 : File Chooser Shortcut Panel folders under on JDK 9
  • Type: CSR
  • Component: client-libs
  • Sub-Component: javax.swing
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 12
  • Submitted: 2018-08-30
  • Updated: 2018-10-05
  • Resolved: 2018-10-05
Related Reports
CSR :  
Description
Summary
-------

New API method was added to query shortcut panel entries for JFileChooser, since ShellFolder is internal class which is not publicly accessible.
 
Problem
-------

ShellFolder is an internal class, and customers do not currently have a way of querying the default shortcut files on Windows, without exporting this class at compile time.

Solution
--------

Solution is to add a new api in javax.swing.filechooser.FileSystemView.java, which can be directly used.

Specification
-------------

Signatures of the api being added and the one for which the documentation is being updated in that order:

        /**
         * Returns an array of files representing the values which will be 
         * shown in the file chooser shortcuts panel.
         *
         * @return an array of {@code File} objects. The array returned may be possibly empty
         * if there are no appropriate permissions.
         * @since 12
         */
        final public File[] getChooserShortcutPanelFiles() 
    
    
        /**
         * Returns an array of files representing the values which will be shown
         * in the file chooser selector
         *
         * @return an array of {@code File} objects. The array returned may be
         * possibly empty if there are no appropriate permissions.
         * @since 9
         */
        public File[] getChooserComboBoxFiles()

Comments
Moving to Approved. In the future, if an existing method is being changed, please include some kind of diff in the specification section as well as via an attached webrev.
05-10-2018

I have added the other api for which the documentation is being changed. I tried many times, but for some reason, the final result is not looking proper, although in the preview mode it was showing it perfectly.
04-10-2018

The fix updates one old method as well, you will need to update CSR.
04-10-2018

I have removed the "Confidential" label, since the changes are all in the open source.
07-09-2018

Moving to Provisional.
06-09-2018

Phil, I have made changes to the text describing the function and added a new webrev. Please have a look at it. Thanks, Krishna
03-09-2018

This issue is marked confidential because the parent issue is marked as such.
03-09-2018

There isn't even a fully qualified class name in this CSR. Saying FileSystemView.java isn't sufficient. > representing the values to show by default "to show" reads as if the caller then uses this value to cause these to be shown. Do you really mean "which will be shown" ? And what does "by default" mean ? What is a non-default case ?
30-08-2018