From 373097f202b75e3b3e7bebff8b7fef214a0d262b Mon Sep 17 00:00:00 2001 From: FionaQY Date: Mon, 4 Nov 2024 14:07:43 +0800 Subject: [PATCH 1/2] Update Help Window --- build.gradle | 3 - .../java/seedu/address/ui/HelpWindow.java | 64 ++++++++----------- src/main/resources/view/HelpWindow.fxml | 5 +- 3 files changed, 27 insertions(+), 45 deletions(-) diff --git a/build.gradle b/build.gradle index 1bde58e52e2..e6aa6383adc 100644 --- a/build.gradle +++ b/build.gradle @@ -61,9 +61,6 @@ dependencies { implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'win' implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'mac' implementation group: 'org.openjfx', name: 'javafx-graphics', version: javaFxVersion, classifier: 'linux' - implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'win' - implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'mac' - implementation group: 'org.openjfx', name: 'javafx-web', version: javaFxVersion, classifier: 'linux' implementation group: 'org.openjfx', name: 'javafx-media' , version:javaFxVersion, classifier: 'win' implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.0' diff --git a/src/main/java/seedu/address/ui/HelpWindow.java b/src/main/java/seedu/address/ui/HelpWindow.java index b343c166495..61501c82a41 100644 --- a/src/main/java/seedu/address/ui/HelpWindow.java +++ b/src/main/java/seedu/address/ui/HelpWindow.java @@ -7,16 +7,16 @@ import java.util.logging.Logger; import javafx.fxml.FXML; -import javafx.scene.control.Button; import javafx.scene.control.Label; import javafx.scene.control.TableCell; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import javafx.scene.control.cell.PropertyValueFactory; +import javafx.scene.input.Clipboard; +import javafx.scene.input.ClipboardContent; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.scene.text.Text; -import javafx.scene.web.WebView; import javafx.stage.Stage; import seedu.address.commons.core.LogsCenter; @@ -33,15 +33,9 @@ public class HelpWindow extends UiPart { private static final Logger logger = LogsCenter.getLogger(HelpWindow.class); private static final String FXML = "HelpWindow.fxml"; - @FXML - private Button openGuideButton; - @FXML private TableView commandTable; - @FXML - private WebView helpMessageWebView; - @FXML private VBox mainContainer; @@ -58,21 +52,6 @@ public HelpWindow(Stage root) { titleLabel.getStyleClass().add("help-title"); mainContainer.getChildren().add(0, titleLabel); initializeCommandTable(); - helpMessageWebView.getEngine().loadContent( - "" - + "

" - + "For more information, please refer to the user guide." - + "

" - ); - - helpMessageWebView.setPrefHeight(50); - - openGuideButton.setMaxWidth(Double.MAX_VALUE); - openGuideButton.setPrefHeight(40); - - setEventHandlers(); } /** @@ -82,14 +61,6 @@ public HelpWindow() { this(new Stage()); } - /** - * Initializes the event handlers for the help window. - * Specifically, it sets the action on the button to open the user guide. - */ - private void setEventHandlers() { - openGuideButton.setOnAction(event -> openUserGuide()); - } - /** * Initializes the command table with predefined columns and items. This method sets up the structure of the table, * including the columns for action, command format, and example, and fills it with data. @@ -117,23 +88,26 @@ private void initializeCommandTable() { "Automatic", "No command required"), new CommandSummary( - "Add New Customer", + "Add New Client", "add n/ p/ e/ a/
j/ i/ " - + "[t/ ] [rn/ ]", + + "[t/ ] [s/ ] [r/ ]", "add n/ TAN LESHEW p/ 99007766 e/ mrtan@ntu.sg a/ com3 j/ doctor i/ 99999 " - + "t/ gold rn/ got anger issue"), - new CommandSummary("Remove Old Customer", + + "t/ gold s/ urgent r/ got anger issue"), + new CommandSummary("Remove Old Client", "delete ", "delete 69"), - new CommandSummary("Edit Existing Customer", + new CommandSummary("Edit Existing Client", "edit n/ p/ e/ a/
j/ i/ " - + "[t/ ] " + + "[t/ ] [s/ ]" + "[rn/ ] [ra/ ]", - "edit 69 n/ TAN LESHEW p/ 77337733 e/ mrtan@ntu.sg a/ COM3 j/ doctor i/ 1000000000" + "edit 69 n/ TAN LESHEW p/ 77337733 e/ mrtan@ntu.sg a/ COM3 j/ doctor i/ 1000000000 " + "ra/ Specialist in eye care"), - new CommandSummary("Find a Customer by Details", + new CommandSummary("Find a Client by Details", "filter / ", "filter n/ TAN LESHEW"), + new CommandSummary("Undo Previous Command", + "undo", + "undo"), new CommandSummary("Help", "help", "help"), @@ -277,5 +251,17 @@ public String getCommandFormat() { public String getExample() { return example; } + + } + + /** + * Copies the URL to the user guide to the clipboard. + */ + @FXML + private void copyUrl() { + final Clipboard clipboard = Clipboard.getSystemClipboard(); + final ClipboardContent url = new ClipboardContent(); + url.putString(USERGUIDE_URL); + clipboard.setContent(url); } } diff --git a/src/main/resources/view/HelpWindow.fxml b/src/main/resources/view/HelpWindow.fxml index bd9fcf12c3c..5d7ee3faf7b 100644 --- a/src/main/resources/view/HelpWindow.fxml +++ b/src/main/resources/view/HelpWindow.fxml @@ -7,7 +7,6 @@ - @@ -28,8 +27,8 @@ - - From c8f8e29ca89cfd084b1a480d3fd0d4603ac0493f Mon Sep 17 00:00:00 2001 From: FionaQY Date: Mon, 4 Nov 2024 14:23:19 +0800 Subject: [PATCH 2/2] Updates Status error message --- src/main/java/seedu/address/model/status/Status.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/seedu/address/model/status/Status.java b/src/main/java/seedu/address/model/status/Status.java index 621c3e281e4..a9116c5b151 100644 --- a/src/main/java/seedu/address/model/status/Status.java +++ b/src/main/java/seedu/address/model/status/Status.java @@ -9,8 +9,8 @@ */ public class Status { - public static final String MESSAGE_CONSTRAINTS = "The statuses are only none, non-urgent and urgent. Please use " - + "only one of them"; + public static final String MESSAGE_CONSTRAINTS = "The Statuses are None, Non_Urgent and Urgent. Please use " + + "one of them."; public final StatusEnum status;