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.
No patch. No fix.
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).
(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
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.
Anyone plans to acctually attach a patch?
I do. I'm going to provide a patch withing few days.