diff options
author | Jonas Smedegaard <dr@jones.dk> | 2025-04-30 13:40:58 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2025-04-30 13:40:58 +0200 |
commit | 19584cfa12e80bd32e686c8da416aaec9aa063b9 (patch) | |
tree | 9d5a30810eb6fef9a5795308d16290de78dd7f76 /src/com.example.portfolio2/com/example/portfolio2/Controller.java | |
parent | f31de856243141d6533d53c0065aefd32fa31b4d (diff) |
improve separation of concerns between view and controller
Diffstat (limited to 'src/com.example.portfolio2/com/example/portfolio2/Controller.java')
-rw-r--r-- | src/com.example.portfolio2/com/example/portfolio2/Controller.java | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/src/com.example.portfolio2/com/example/portfolio2/Controller.java b/src/com.example.portfolio2/com/example/portfolio2/Controller.java index 66519ae..3354dcd 100644 --- a/src/com.example.portfolio2/com/example/portfolio2/Controller.java +++ b/src/com.example.portfolio2/com/example/portfolio2/Controller.java @@ -42,23 +42,15 @@ class Controller { /// callback when category has been selected /// + /// @param section section the category is tied to /// @param category selected category - /// @param select activity selection object - /// @param area activity listing object + // TODO: require a UI instead void onCategorySelected( - final String category, - final ComboBox<String> select, - final TextArea area + final GUI.Section section, + final String category ) { - - // clear the activity selection box - select.getItems().clear(); - - // clear text area - area.clear(); - - // fill activity box from data in store - select.getItems().addAll(store.selectProgram(category)); + view.clearSelections(section); + view.setOptions(section,store.selectProgram(category)); } /// callback when activity has been selected |