diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 11:05:31 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-29 11:05:45 +0200 |
commit | 2f623fff0b88668bfbe9c38710830c0a72dac621 (patch) | |
tree | ff6647e18ecc6641d662f42b7b89ec7091b6e9e8 /src/com.example.portfolio2 | |
parent | 256b3a52aa9c6085ce2efe8dfcebf4273d3bba9e (diff) |
use record for private class ActivityColumn
Diffstat (limited to 'src/com.example.portfolio2')
-rw-r--r-- | src/com.example.portfolio2/com/example/portfolio2/Window.java | 54 |
1 files changed, 24 insertions, 30 deletions
diff --git a/src/com.example.portfolio2/com/example/portfolio2/Window.java b/src/com.example.portfolio2/com/example/portfolio2/Window.java index 68a2c17..53ac020 100644 --- a/src/com.example.portfolio2/com/example/portfolio2/Window.java +++ b/src/com.example.portfolio2/com/example/portfolio2/Window.java @@ -168,36 +168,30 @@ public final class Window extends Application { } /// column of activities - private class ActivityColumn { - - /// identifier stored in the text felt - String name; - - /// display text - Label nameLabel; - - /// dropdown list for categories - ComboBox<String> categoryCombo; - - /// dropdown list for activities - ComboBox<String> activitySelect; - - /// descriptionof chosen activities - TextArea area; - - /// text to display ECTS points - Label ectsLabel; - - /// column of activities - /// - /// @param name identifier - ActivityColumn(final String name) { - this.name = name; - nameLabel = new Label(name); - categoryCombo = new ComboBox<>(); - activitySelect = new ComboBox<>(); - area = new TextArea(); - ectsLabel = new Label(); + /// + /// @param name identifier stored in the text felt + /// @param nameLabel display text + /// @param categoryCombo dropdown list for categories + /// @param activitySelect dropdown list for activities + /// @param area description of chosen activities + /// @param ectsLabel text to display ECTS points + private record ActivityColumn( + String name, + Label nameLabel, + ComboBox<String> categoryCombo, + ComboBox<String> activitySelect, + TextArea area, + Label ectsLabel + ) { + public ActivityColumn(String name) { + this( + name, + new Label(name), + new ComboBox<>(), + new ComboBox<>(), + new TextArea(), + new Label() + ); } /// activity columne as VBox |