aboutsummaryrefslogtreecommitdiff
path: root/src/com.example.portfolio2
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2025-04-29 11:05:31 +0200
committerJonas Smedegaard <dr@jones.dk>2025-04-29 11:05:45 +0200
commit2f623fff0b88668bfbe9c38710830c0a72dac621 (patch)
treeff6647e18ecc6641d662f42b7b89ec7091b6e9e8 /src/com.example.portfolio2
parent256b3a52aa9c6085ce2efe8dfcebf4273d3bba9e (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.java54
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