示例#1
0
  public FileTreePane() {
    loadDynamicComponentFxml(FileTreePane.class, this);
    rootFileTreeItem = new RootFileTreeItem(this);

    // The root here is *not* the real root of the file system and should be hidden, because
    // (1) we might want to have 'virtual' visible roots like "Home", "Desktop", "Drives" and
    // (2) even if we displayed only the real file system without any shortcuts like "Desktop",
    // we'd still have multiple roots on a crappy pseudo-OS like Windows still having these shitty
    // drive letters.
    treeTableView.setShowRoot(false);
    treeTableView.setRoot(rootFileTreeItem);
    treeTableView.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
    treeTableView
        .getSelectionModel()
        .selectedItemProperty()
        .addListener(
            (ChangeListener<TreeItem<FileTreeItem<?>>>)
                (observable, o, n) -> updateSelectedFiles());
    treeTableView
        .getSelectionModel()
        .getSelectedItems()
        .addListener((InvalidationListener) observable -> updateSelectedFiles());

    selectedFiles.addListener(selectedFilesChangeListener);
    showHiddenFilesCheckBox.selectedProperty().bindBidirectional(showHiddenFilesProperty);

    // TODO remove the following line - preferably replace by proper, use-case-dependent management!
    selectedFiles.add(IOUtil.getUserHome());
    updateDisable();
  }
示例#2
0
 public void addListenerToBuyerSet(SetChangeListener<? super EconomicAgent> setChangeListener) {
   buyers.addListener(setChangeListener);
 }