项目作者: thetric

项目描述 :
JavaFX control for displaying and watching the contents of a directory
高级语言: XSLT
项目地址: git://github.com/thetric/jfx-directory-viewer.git
创建时间: 2017-03-26T16:57:40Z
项目社区:https://github.com/thetric/jfx-directory-viewer

开源协议:MIT License

下载


jfx-directory-viewer

Travis
GitHub release

Provides a JavaFX component displaying the files and directories of a directory as a list.
The view is updated automatically if something in the directory has changed.

Motivation

Sadly JavaFX does not provide such a component out of the box.
Although JFX provides file and directory choosers you cannot embed them into your application.
This little library wants to change this!

Add as dependency

You can get the library via JitPack.io.

  1. // add JitPack.io repository
  2. repositories {
  3. maven { url 'https://jitpack.io' }
  4. }
  5. // add dependency
  6. dependencies {
  7. compile 'com.github.thetric:jfx-directory-viewer:1.0'
  8. }

Usage

  1. final DirectoryListView dirListView = new DirectoryListView();
  2. final Path startDir = Paths.get(System.getProperty("user.home"));
  3. // updates list view automatically to the new root path
  4. dirListView.setCurrentDirectory(startDir);
  5. // or
  6. dirListView.currentDirectoryProperty().set()
  7. // clean up after disposing
  8. dirListView.unwatchDirectory();