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 207496 - FileChooserBuilder should be able to work with other file systems
Summary: FileChooserBuilder should be able to work with other file systems
Status: REOPENED
Alias: None
Product: platform
Classification: Unclassified
Component: Filesystems (show other bugs)
Version: 7.2
Hardware: PC Solaris
: P3 normal (vote)
Assignee: Vladimir Kvashin
URL:
Keywords: API_REVIEW_FAST
Depends on:
Blocks: 236358 207488
  Show dependency tree
 
Reported: 2012-01-19 08:18 UTC by Vladimir Kvashin
Modified: 2014-11-10 10:41 UTC (History)
5 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Kvashin 2012-01-19 08:18:15 UTC
org.openide.filesystems.FileChooserBuilder now works with disk file system only
It would be fine if it could get an instance of FileSystem in constructor and create a chooser for this file system.

There already is such functionality in org.netbeans.modules.dlight.remote; but it is too tightly connected with execution. I propose make org.openide.filesystems.FileChooserBuilder more general instead.

I'm not quite sure org.openide.filesystems is right place for such functionality, but once existing FileChooserBuilder is there, I would propose to extend it.
Comment 1 Jaroslav Tulach 2012-01-19 16:12:05 UTC
Patch?
Comment 2 Jaroslav Tulach 2012-01-26 07:28:09 UTC
No patch. No fix.
Comment 3 Jaroslav Havlin 2014-02-04 15:11:31 UTC
Having some file chooser that is able to work with file FileObjects seems quite reasonable. But it may be quite complicated.

Should the chooser support a single file system, or all known (local and remote) file system? The letter option seems more user friendly.

Extending FileChooserBuilder would be cumbersome. I would prefer creating a new class, e.g. FileObjectChooserBuilder, and related SPI classes (if needed).
Comment 4 Vladimir Kvashin 2014-02-04 18:03:12 UTC
(In reply to Jaroslav Havlin from comment #3)
...
> Should the chooser support a single file system, or all known (local and
> remote) file system? The letter option seems more user friendly.

I see two optoins here:

1) File chooser builder that is parameterized with FileSystem. This will help to solve issue 236358 easily

2) File chooser that is parameterized with an SPI interface (TBD), the interface provides a list of available file systems and their display names. File chooser allows to choose file system and then choose file in this file system.

Sure option (2) is much more complicated. The benefit is that it allows (for example) the following:
- menu item on Favorites that allows adding different file systems
- comon "Open project" / "Create project" actions (now CND has its own "Open Remote Project" and "Create Remote Project" actions in "Remote" toolbar (but not in menu).
- other situations similar to above

> 
> Extending FileChooserBuilder would be cumbersome. I would prefer creating a
> new class, e.g. FileObjectChooserBuilder, and related SPI classes (if
> needed).

I'm ok with that.

Just FYI, there is an example of FileObject-based file chooser / builder in o.n.m.remote.api.ui.FileChooserBuilder class in dlight.remote module.
Comment 5 Jaroslav Tulach 2014-11-05 12:15:56 UTC
Anyone plans to acctually attach a patch?
Comment 6 Vladimir Kvashin 2014-11-10 10:41:19 UTC
I do. I'm going to provide a patch withing few days.