Oliver-Loeffler / FXFileChooser

Custom JavaFX file chooser which allows quick manual filtering, which allows to add Path predicates as filter and which is testable using TestFX.
Apache License 2.0
44 stars 8 forks source link

Make JavaFX FileChooser and DirectoryChooser acessible from Swing #26

Closed Oliver-Loeffler closed 5 years ago

Oliver-Loeffler commented 5 years ago

Create adapters so that JavaFX DirectoryChooser and FileChooser classes can be used instead of JFileChooser. Ideally the appearing dialogs shall be modal. If modality cannot be achieved, at least there should be a mechanism which prevents multiple dialogs to be started concurrently.

Also it would be nice if instance would remain configurable through JavaFX API and if there would be a central factory to create the now various instances of file choosers.

Oliver-Loeffler commented 5 years ago

New type StandardDirectoryChooser and StandardFileChooser can now be used from Swing user interfaces. On Windows modality works (parent has no focus, cannot be focused and is disabled).

On OSX however, parent is only disabled but stilll focusable. Linux not yet tested.

Both types offer a getDialog method which exposes the actual dialog so that a customization can be done. The API finally is mostly identical with JFileChooser so that both types can be used as a drop in replacement. Supported methods are JFileChooser.showOpenDialog and JFileChooser.showSaveDialog as well as JFileChooser.showDialog.

Works since c8d451b1967430f8ce58e844e18b1b16fd8835c0.