From d2d9a288a8a48d334880ef171114ceddf3c09291 Mon Sep 17 00:00:00 2001 From: leonie Date: Wed, 16 Nov 2022 13:37:49 +0100 Subject: [PATCH] #1454 added a button to start search, made search bar functional --- .../com/devonfw/cobigen/gui/Controller.java | 7 +- .../com/devonfw/cobigen/gui/HomeScreen.fxml | 121 +++--- .../com/devonfw/cobigen/gui/Primary.fxml | 11 +- .../devonfw/cobigen/gui/SearchResults.fxml | 387 +++++++++--------- 4 files changed, 280 insertions(+), 246 deletions(-) diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java index 5a147b058d..1ee9380b0d 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/Controller.java @@ -14,7 +14,6 @@ import javafx.scene.control.Button; import javafx.scene.control.ListView; import javafx.scene.control.TextField; -import javafx.scene.input.KeyEvent; import javafx.scene.layout.AnchorPane; /** @@ -40,6 +39,9 @@ public class Controller implements Initializable { @FXML public TextField searchBar; + @FXML + public Button goSearch; + // TODO: Transform to ListView @FXML public ListView searchResultsView; @@ -70,9 +72,10 @@ public void details(javafx.event.ActionEvent actionEvent) throws IOException { /** * @param event + * @throws IOException */ @FXML - public void search(KeyEvent event) { + public void search(javafx.event.ActionEvent event) throws IOException { this.searchResultsView.getItems().clear(); this.searchResultsView.getItems().addAll(searchTemplateSets(this.searchBar.getText(), this.templateSets)); diff --git a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/HomeScreen.fxml b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/HomeScreen.fxml index 4c070d27fa..e359709704 100644 --- a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/HomeScreen.fxml +++ b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/HomeScreen.fxml @@ -2,57 +2,70 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/Primary.fxml b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/Primary.fxml index e3a6cdc062..4650c8f58d 100644 --- a/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/Primary.fxml +++ b/cobigen/gui/src/main/resources/com/devonfw/cobigen/gui/Primary.fxml @@ -18,7 +18,7 @@ - + @@ -64,14 +64,17 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +