From 7c11411dcf3c410124685d81f4e040ef2e7b85c7 Mon Sep 17 00:00:00 2001 From: Stefan Suhren Date: Tue, 5 May 2015 08:45:31 +0200 Subject: Use mnemonics und accalerators --- .../in/inf/java2/aufgabe05/MainApplication.java | 1 - .../view/DirectoryOverviewController.java | 31 ++++++++++++---------- .../java2/aufgabe05/view/DirectoryTableView.java | 7 +++++ .../in/inf/java2/aufgabe05/view/RootLayout.fxml | 27 ++++++++++++++----- 4 files changed, 44 insertions(+), 22 deletions(-) (limited to 'src') diff --git a/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java b/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java index 7978cb1..39c7161 100644 --- a/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java +++ b/src/de/fhswf/in/inf/java2/aufgabe05/MainApplication.java @@ -5,7 +5,6 @@ import java.io.IOException; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; -import javafx.scene.control.SplitPane; import javafx.scene.layout.AnchorPane; import javafx.scene.layout.BorderPane; import javafx.stage.Stage; diff --git a/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryOverviewController.java b/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryOverviewController.java index d12efee..e1b2cbb 100644 --- a/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryOverviewController.java +++ b/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryOverviewController.java @@ -1,9 +1,8 @@ /** * */ -package de.fhswf.in.inf.java2.aufgabe05.view; -import java.io.File; +package de.fhswf.in.inf.java2.aufgabe05.view; import javafx.fxml.FXML; import javafx.scene.control.TableView; @@ -13,21 +12,25 @@ import de.fhswf.fbin.java2fx.trees.DirectoryTreeView; /** * TODO Add comment here * - * @author $Author: $ - * @version $Revision: $, $Date: $ UTC + * @author $Author: $ + * @version $Revision: $, $Date: $ UTC */ public class DirectoryOverviewController { @FXML private AnchorPane leftPane; - + @FXML private AnchorPane rightPane; - + private DirectoryTreeView dirTree; - + private DirectoryTableView dirTab; - + + /** + * Builds the view with custom controls. + * + */ @FXML private void initialize() { @@ -37,19 +40,19 @@ public class DirectoryOverviewController 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()); - }); + .addListener((ov, oldParent, newParent) -> { + dirTab.getParentDirectoryProperty().set(newParent.getValue()); + }); } } diff --git a/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryTableView.java b/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryTableView.java index 0b76632..456e48c 100644 --- a/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryTableView.java +++ b/src/de/fhswf/in/inf/java2/aufgabe05/view/DirectoryTableView.java @@ -11,6 +11,7 @@ import java.util.List; import javafx.beans.property.SimpleObjectProperty; import javafx.collections.FXCollections; +import javafx.scene.control.Label; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; @@ -34,8 +35,14 @@ public class DirectoryTableView extends TableView return parentDirectoryProperty; } + /** + * TODO Add constructor comment here + * + * @param parentDirectory + */ public DirectoryTableView(FXFile parentDirectory) { + setPlaceholder(new Label("Verzeichnis ist leer.")); this.parentDirectoryProperty = new SimpleObjectProperty(parentDirectory); // name column with default cell factory diff --git a/src/de/fhswf/in/inf/java2/aufgabe05/view/RootLayout.fxml b/src/de/fhswf/in/inf/java2/aufgabe05/view/RootLayout.fxml index c060ace..3acea57 100644 --- a/src/de/fhswf/in/inf/java2/aufgabe05/view/RootLayout.fxml +++ b/src/de/fhswf/in/inf/java2/aufgabe05/view/RootLayout.fxml @@ -1,5 +1,6 @@ + @@ -9,20 +10,32 @@ - + - + + + + - + - - + + + + + + + + - + - + + + + -- cgit v1.2.3-70-g09d2