com.legyver.fenxlib.widgets.filetree.FileExplorerSkin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fenxlib.widgets.filetree Show documentation
Show all versions of fenxlib.widgets.filetree Show documentation
FileTree widget for Fenxlib projects
package com.legyver.fenxlib.widgets.filetree;
import com.jfoenix.controls.JFXTreeView;
import com.legyver.fenxlib.core.api.event.handlers.ShowContextMenuEventHandler;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.SkinBase;
/**
* Skin for the {@link BaseFileExplorer}
*/
public class FileExplorerSkin extends SkinBase {
private final JFXTreeView jfxTreeView;
/**
* Construct a skin for the given FileExplorer
* @param fileExplorer the FileExplorer to skin.
*/
@SuppressWarnings("unchecked")
public FileExplorerSkin(BaseFileExplorer fileExplorer) {
super(fileExplorer);
jfxTreeView = new JFXTreeView(fileExplorer.getPseudoRoot());
jfxTreeView.setShowRoot(false);
fileExplorer.refreshPulseProperty().addListener((observable, oldValue, newValue) -> jfxTreeView.refresh());
jfxTreeView.setOnContextMenuRequested(new ShowContextMenuEventHandler(jfxTreeView, fileExplorer.getContextMenu()));
getChildren().add(jfxTreeView);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy