jfx-filechooser-adapter-api

JavaFX FileChooser and DirectoryChooser adapter that can be used in a Swing application.

Лицензия

Лицензия

Группа

Группа

com.github.mrcjkb
Идентификатор

Идентификатор

jfx-filechooser-adapter-api
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

pom.sha512
Описание

Описание

jfx-filechooser-adapter-api
JavaFX FileChooser and DirectoryChooser adapter that can be used in a Swing application.
Ссылка на сайт

Ссылка на сайт

https://github.com/MrcJkb/jfx-filechooser-adapter/
Система контроля версий

Система контроля версий

https://github.com/MrcJkb/jfx-filechooser-adapter/

Скачать jfx-filechooser-adapter-api

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

jfx-filechooser-adapter

An adapter for a JavaFX File- and DirectoryChooser that allows for use in Swing

Maven Central

Requirements

  • Java 11
  • JavaFX 11.0.2 Jmods

Usage

The class JfxFileChooserAdapterModuleContext provides the module context, from which the file chooser builder can be accessed:

JfxFileChooserAdapterModuleContext.getFileChooserBuilder()

To begin invocation, call the init() or the init(String identifier) method. The optional identifier parameter can be used to remember the last selected directory. Without a parameter, a default identifier is used. From there, the fluent API has been designed to guide you through the valid options. Depending on previous choices, invalid options are hidden from the interface.

See the demo project for usage examples.

Setting a Swing parent window for the JavaFX FileChooser or DirectoryChooser

To set a Swing parent window, the IFileChooserBuilder interface provides the optional method addToSwingParent(Consumer<JComponent> addToSwingParentCallback). If this method is called, and the addToSwingParentCallback adds the provided (invisible) JComponent to a Swing Container, the Container's parent window is detected. Upon invocation, the file chooser builder attempts to position the file chooser on top of the detected Swing window. Unfortunately, this does not always work (e.g. on Windows 10, in a multi monitor setup).

Contribution

Architecture

This project is split into a parent project with three subprojects:

  • jfx-filechooser-adapter-parent: Contains the module context, which provides the entry to the API
  • jfx-filechooser-adapter-api: Contains the Java interfaces
  • jfx-filechooser-adapter-impl: Contains the implementation
  • javafx-wrapper: A wrapper for encapsulating JavaFX from the main projects

Additionally, the project jfx-filechooser-adapter-demo is included for demonstration purposes.

It is intended that a client accesses only the jfx-filechooser-adapter-parent project directly, which encapsulates the implementations. Architecture rules are enforced using ArchUnit.

Limitations

Due to a bug in Gradle JavaFX plugin, no tests can be added to the javafx-wrapper project.

Версии библиотеки

Версия
1.0.1
1.0.0
0.0.1