From 3c13c1361051edab2e2c90112f6169ab08205189 Mon Sep 17 00:00:00 2001 From: nelsonnew Date: Mon, 2 Jan 2023 10:59:28 +0100 Subject: [PATCH] #1454 Make use of ArtifactRetriever --- cobigen-cli/cli/pom.xml | 11 ++ .../cobigen/cli/commands/ManageCommand.java | 1 - cobigen/gui/pom.xml | 184 +++++++++--------- .../com/devonfw/cobigen/gui/Controller.java | 4 +- .../com/devonfw/cobigen/gui/TemplateSet.java | 37 ---- .../gui/controllers/MenuController.java | 27 ++- .../cobigen/gui/services/TemplateSetCell.java | 5 +- .../gui/services/TemplateSetCellFactory.java | 2 +- cobigen/pom.xml | 5 +- pom.xml | 2 +- 10 files changed, 132 insertions(+), 146 deletions(-) delete mode 100644 cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java diff --git a/cobigen-cli/cli/pom.xml b/cobigen-cli/cli/pom.xml index 7cea091b50..e9bbec35c2 100644 --- a/cobigen-cli/cli/pom.xml +++ b/cobigen-cli/cli/pom.xml @@ -13,6 +13,7 @@ false + 18 @@ -56,6 +57,16 @@ google-java-format 1.10.0 + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + diff --git a/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/ManageCommand.java b/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/ManageCommand.java index 26303e23ea..15fc2717cb 100644 --- a/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/ManageCommand.java +++ b/cobigen-cli/cli/src/main/java/com/devonfw/cobigen/cli/commands/ManageCommand.java @@ -31,7 +31,6 @@ public synchronized Integer doAction() throws Exception { try { wait(1337); } catch (InterruptedException e) { - // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/cobigen/gui/pom.xml b/cobigen/gui/pom.xml index 1175b4a1f8..a2ef2cf548 100644 --- a/cobigen/gui/pom.xml +++ b/cobigen/gui/pom.xml @@ -1,94 +1,98 @@ - - 4.0.0 - gui - jar + + 4.0.0 + gui + jar - - com.devonfw.cobigen - core-parent - ${revision} - + + com.devonfw.cobigen + core-parent + ${revision} + - - false - UTF-8 - 11 - 11 - 18 - 0.0.6 - + + false + UTF-8 + 11 + 11 + 18 + 0.0.6 + - - - org.openjfx - javafx-controls - ${javafx.version} - - - org.openjfx - javafx-fxml - ${javafx.version} - - - junit - junit - 4.13.1 - - - org.testfx - testfx-core - 4.0.16-alpha - test - - - org.testfx - testfx-junit - 4.0.15-alpha - test - - - org.assertj - assertj-core - 3.13.2 - test - - - org.kordamp.ikonli - ikonli-javafx - 11.3.5 - - - org.kordamp.ikonli - ikonli-materialdesign-pack - 11.3.5 - - - - - - org.apache.maven.plugins - maven-compiler-plugin - - ${maven.compiler.release} - - - - org.openjfx - javafx-maven-plugin - ${javafx.maven.plugin.version} - - com.devonfw.cobigen.gui.App - - - - org.apache.maven.plugins - maven-surefire-plugin - - - false - - - - + + + org.openjfx + javafx-controls + ${javafx.version} + + + org.openjfx + javafx-fxml + ${javafx.version} + + + junit + junit + 4.13.1 + + + org.testfx + testfx-core + 4.0.16-alpha + test + + + org.testfx + testfx-junit + 4.0.15-alpha + test + + + org.assertj + assertj-core + 3.13.2 + test + + + org.kordamp.ikonli + ikonli-javafx + 11.3.5 + + + org.kordamp.ikonli + ikonli-materialdesign-pack + 11.3.5 + + + com.devonfw.cobigen + core-artifact-retriever + ${revision} + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + ${maven.compiler.release} + + + + org.openjfx + javafx-maven-plugin + ${javafx.maven.plugin.version} + + com.devonfw.cobigen.gui.App + + + + org.apache.maven.plugins + maven-surefire-plugin + + + false + + + + \ No newline at end of file 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 c56effc220..8c7b063962 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 @@ -7,6 +7,7 @@ import com.devonfw.cobigen.gui.controllers.DetailsController; import com.devonfw.cobigen.gui.controllers.HomeController; import com.devonfw.cobigen.gui.controllers.MenuController; +import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -104,7 +105,8 @@ public void loadDetails() throws IOException { } else { this.home.setVisible(false); this.details.setVisible(true); - this.detailsController.showName(selectedItem.getName()); + // TODO + this.detailsController.showName(selectedItem.getTemplateSetVersion()); } } diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java deleted file mode 100644 index 423004c191..0000000000 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/TemplateSet.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.devonfw.cobigen.gui; - -/** - * TODO nneuhaus This type ... - * - */ -public class TemplateSet { - private String name; - - /** - * The constructor. - * - * @param name - */ - public TemplateSet(String name) { - - super(); - this.name = name; - } - - /** - * @return name - */ - public String getName() { - - return this.name; - } - - /** - * @param name new value of {@link #getname}. - */ - public void setName(String name) { - - this.name = name; - } - -} diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java index 6484fb07ad..010ad668ca 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/controllers/MenuController.java @@ -5,8 +5,8 @@ import java.util.ResourceBundle; import com.devonfw.cobigen.gui.Controller; -import com.devonfw.cobigen.gui.TemplateSet; import com.devonfw.cobigen.gui.services.TemplateSetCell; +import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; import javafx.collections.FXCollections; import javafx.collections.ObservableList; @@ -52,9 +52,18 @@ public MenuController() { this.templateSetObservableList = FXCollections.observableArrayList(); - // Add the template sets, populate observable list ( before initialize) - this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"), - new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4")); + // Add the template sets, populate observable list (before initialize) + // this.templateSetObservableList.addAll(new TemplateSet("Template Set 1"), new TemplateSet("Template Set 2"), + // new TemplateSet("Template Set 3"), new TemplateSet("Template Set 4")); + + // Path templateSetFile = Paths.get(testdataRoot).resolve("template-set.xml"); + // + // TemplateSetArtifactReader artifactReader = new TemplateSetArtifactReader(); + // + // TemplateSet templateSet = artifactReader.retrieveTemplateSet(templateSetFile); + // + // List tagsList = new ArrayList<>(); + // tagsList.addAll(templateSet.getTemplateSetConfiguration().getContextConfiguration().getTags().getTagsList()); } /** @@ -110,14 +119,14 @@ public void handle(MouseEvent event) { String searchKeyword = newValue.toLowerCase(); // found a match in the name - if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) { - return true; - } + // if (templateSets.getName().toLowerCase().indexOf(searchKeyword) > -1) { + // return true; + // } // add more if statements of this form // if more search relevant attributes are added to the TemplateSet Class! - else - return false; + // else + return false; }); this.searchResultsView.setItems(filteredData); diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java index 572fa04686..99b072f536 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCell.java @@ -2,7 +2,7 @@ import java.io.IOException; -import com.devonfw.cobigen.gui.TemplateSet; +import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; import javafx.fxml.FXML; import javafx.fxml.FXMLLoader; @@ -50,7 +50,8 @@ protected void updateItem(TemplateSet templateSet, boolean empty) { } } - this.titleLabel.setText(templateSet.getName()); + // TODO: + // this.titleLabel.setText(templateSet.getName()); // setText(templateSet.getName()); this.installButton.setOnAction(event -> { System.out.println("INSTALLIEREN!!!"); diff --git a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java index 25a81f7b78..2d4cea3561 100644 --- a/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java +++ b/cobigen/gui/src/main/java/com/devonfw/cobigen/gui/services/TemplateSetCellFactory.java @@ -1,6 +1,6 @@ package com.devonfw.cobigen.gui.services; -import com.devonfw.cobigen.gui.TemplateSet; +import com.devonfw.cobigen.retriever.reader.to.model.TemplateSet; import javafx.scene.control.ListCell; import javafx.scene.control.ListView; diff --git a/cobigen/pom.xml b/cobigen/pom.xml index 9466b6245d..f13661d83e 100644 --- a/cobigen/pom.xml +++ b/cobigen/pom.xml @@ -17,10 +17,7 @@ cobigen-core-test cobigen-core-systemtest core-externalprocess-api -<<<<<<< HEAD - gui -======= core-artifact-retriever ->>>>>>> template-set-deployables + gui \ No newline at end of file diff --git a/pom.xml b/pom.xml index 48ef2c1a7a..1239859755 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,5 @@ - + 4.0.0 com.devonfw.cobigen master-parent