This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 152750

Summary: API for consistent handling of file choosers
Product: platform Reporter: _ tboudreau <tboudreau>
Component: FilesystemsAssignee: apireviews <apireviews>
Status: RESOLVED DUPLICATE    
Severity: blocker CC: jglick
Priority: P2    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Attachments: org.openide.filesystems.FileChooserBuilder

Description _ tboudreau 2008-11-08 00:53:38 UTC
One consistent annoyance in NetBeans is that there are many dialogs and UIs which display JFileChoosers, but they are
not handled consistently.  For example, many usages of file choosers do not remember the last chosen directory when that
UI was last used, so you click "Browse" once, and navigate some complicated directory structure to get to where you
want;  the next time you use the same UI you have to browse again.  A more professional UI would be consistent about
this sort of behavior, and it is easy to do.

I am proposing a small API which would use NbPreferences to store the current directory based on unique keys provided by
the client, makes use of JFileChoosers simpler, and also handles the case of badging files (needed for both platforms
and projects - currently there are many copies of the same code to do this).

This might ideally go into the Utilities API, as it is File-related, not FileObject-related.  However, it needs access
to FileUtil.preventFileChooserSymlinkTraversal(), so if we want this to go in Utilities, the FileUtil code should be
moved there and the old version deprecated.
Comment 1 _ tboudreau 2008-11-08 00:54:30 UTC
Created attachment 73522 [details]
org.openide.filesystems.FileChooserBuilder
Comment 2 _ tboudreau 2008-11-08 05:06:37 UTC
Alternate potential location for this, which would be intuitive, is the dialogs API - but we have the same problem of
needing to add a dep on filesystems.
Comment 3 Jesse Glick 2008-11-10 17:31:34 UTC
Please use the original issue.

*** This issue has been marked as a duplicate of 47737 ***
Comment 4 _ tboudreau 2008-11-12 01:47:32 UTC
Note, class in code is not final but should be.