Code aufräumen

This commit is contained in:
2026-04-28 08:52:59 +02:00
parent 27b4292c2f
commit 8bb0aabb51
5 changed files with 9 additions and 66 deletions
@@ -2608,50 +2608,6 @@ public final class GuiConfigurationEditorWorkspace {
return label;
}
/**
* Builds a labelled path-field row as a {@link VBox} containing a grid row with the field
* and picker button, plus an optional error-slot label directly beneath.
* <p>
* The method uses an 8-pixel top padding to separate consecutive field rows visually, matching
* the former grid vgap behaviour.
*
* @param labelText the row label text; must not be {@code null}
* @param field the text field; must not be {@code null}
* @param errorLabel the field-level error label, or {@code null} for no error slot
* @param onPick action invoked when the picker button is clicked; must not be {@code null}
* @return a VBox containing the labelled row and optional error slot
*/
private static VBox buildPathFieldRow(String labelText, TextField field,
Label errorLabel, Runnable onPick) {
Label label = new Label(labelText);
Button pickButton = new Button("");
pickButton.setOnAction(e -> onPick.run());
pickButton.setMinWidth(32);
HBox fieldBox = new HBox(4, field, pickButton);
HBox.setHgrow(field, Priority.ALWAYS);
fieldBox.setAlignment(Pos.CENTER_LEFT);
GridPane grid = new GridPane();
grid.setHgap(12);
grid.setVgap(0);
javafx.scene.layout.ColumnConstraints labelCol = new javafx.scene.layout.ColumnConstraints();
labelCol.setMinWidth(180);
labelCol.setPrefWidth(200);
javafx.scene.layout.ColumnConstraints fieldCol = new javafx.scene.layout.ColumnConstraints();
fieldCol.setFillWidth(true);
fieldCol.setHgrow(Priority.ALWAYS);
grid.getColumnConstraints().addAll(labelCol, fieldCol);
grid.add(label, 0, 0);
grid.add(fieldBox, 1, 0);
grid.setPadding(new Insets(4, 0, 0, 0));
VBox slot = new VBox(0, grid);
if (errorLabel != null) {
slot.getChildren().add(errorLabel);
}
return slot;
}
/**
* Baut zwei Pfad-Felder nebeneinander in einer HBox. Jedes Feld hat ein Label und einen Picker-Button.
* Error-Labels werden untereinander angezeigt.
@@ -2786,19 +2742,6 @@ public final class GuiConfigurationEditorWorkspace {
return field;
}
/**
* Adds a label and a text field (without a picker button) to the given grid row.
*
* @param grid the target grid pane
* @param row the grid row index
* @param labelText the row label text
* @param field the text field to place
*/
private static void addSimpleRow(GridPane grid, int row, String labelText, TextField field) {
grid.add(new Label(labelText), 0, row);
grid.add(field, 1, row);
}
/**
* Erstellt ein GridPane für Konfigurationsfelder mit kompaktem vertikalen Abstand.
*/
@@ -204,7 +204,6 @@ public final class GuiBatchRunTab {
private final GuiBatchRunCoordinator coordinator;
private final Supplier<GuiManualFileRenamePort> manualFileRenamePortSupplier;
private final Supplier<GuiManualFileCopyPort> manualFileCopyPortSupplier;
private final Supplier<GuiHistoricalDocumentContextPort> historicalDocumentContextPortSupplier;
private final Supplier<Optional<Path>> sourceFolderSupplier;
private final Supplier<Optional<String>> targetFolderSupplier;
@@ -275,7 +274,7 @@ public final class GuiBatchRunTab {
manualFileRenamePortSupplier, "manualFileRenamePortSupplier must not be null");
this.manualFileCopyPortSupplier = Objects.requireNonNull(
manualFileCopyPortSupplier, "manualFileCopyPortSupplier must not be null");
this.historicalDocumentContextPortSupplier = Objects.requireNonNull(
Objects.requireNonNull(
historicalDocumentContextPortSupplier, "historicalDocumentContextPortSupplier must not be null");
this.sourceFolderSupplier = Objects.requireNonNull(
sourceFolderSupplier, "sourceFolderSupplier must not be null");
@@ -654,8 +653,8 @@ public final class GuiBatchRunTab {
}
});
resultTable.getColumns().setAll(
checkboxCol, iconCol, nameCol, newNameCol, dateCol, durationCol);
resultTable.getColumns().setAll(List.of(
checkboxCol, iconCol, nameCol, newNameCol, dateCol, durationCol));
// Selektion im TableView synchronisiert selectedRows und Checkboxen.
resultTable.getSelectionModel().getSelectedItems().addListener(