/** * */ package de.fhswf.in.inf.java2.aufgabe05.view; import java.io.File; import javafx.fxml.FXML; import javafx.scene.control.TableView; import javafx.scene.layout.AnchorPane; import de.fhswf.fbin.java2fx.trees.DirectoryTreeView; /** * TODO Add comment here * * @author $Author: $ * @version $Revision: $, $Date: $ UTC */ public class DirectoryOverviewController { @FXML private AnchorPane leftPane; @FXML private AnchorPane rightPane; private DirectoryTreeView dirTree; private DirectoryTableView dirTab; @FXML private void initialize() { dirTree = new DirectoryTreeView(); leftPane.getChildren().add(dirTree); AnchorPane.setTopAnchor(dirTree, 0.0); AnchorPane.setBottomAnchor(dirTree, 0.0); AnchorPane.setLeftAnchor(dirTree, 0.0); AnchorPane.setRightAnchor(dirTree, 0.0); dirTab = new DirectoryTableView(dirTree.getRoot().getValue()); rightPane.getChildren().add(dirTab); AnchorPane.setTopAnchor(dirTab, 0.0); AnchorPane.setBottomAnchor(dirTab, 0.0); AnchorPane.setLeftAnchor(dirTab, 0.0); AnchorPane.setRightAnchor(dirTab, 0.0); dirTab.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY); dirTree.getSelectionModel().selectedItemProperty() .addListener((ov, oldParent, newParent) -> { dirTab.getParentDirectoryProperty().set(newParent.getValue()); }); } }