forked from nus-cs2103-AY2425S1/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Status error message #181
Merged
FionaQY
merged 2 commits into
AY2425S1-CS2103T-T14-4:master
from
FionaQY:update-status-error
Nov 4, 2024
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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<Stage> { | |
private static final Logger logger = LogsCenter.getLogger(HelpWindow.class); | ||
private static final String FXML = "HelpWindow.fxml"; | ||
|
||
@FXML | ||
private Button openGuideButton; | ||
|
||
@FXML | ||
private TableView<CommandSummary> 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( | ||
"<html><body style='display: flex; justify-content: center; align-items: center; height: 100%; " | ||
+ "margin: 0; padding: 0; background-color: #2b2b2b;'>" | ||
+ "<p style='color: #e6e6e6; font-family: \"Segoe UI\", sans-serif; font-size: 14pt; " | ||
+ "text-align: center;'>" | ||
+ "For more information, please refer to the user guide." | ||
+ "</p></body></html>" | ||
); | ||
|
||
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/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> " | ||
+ "[t/ <TIER>] [rn/ <REMARK>]", | ||
+ "[t/ <TIER>] [s/ <STATUS>] [r/ <REMARK>]", | ||
"add n/ TAN LESHEW p/ 99007766 e/ [email protected] 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 <INDEX>", | ||
"delete 69"), | ||
new CommandSummary("Edit Existing Customer", | ||
new CommandSummary("Edit Existing Client", | ||
"edit <INDEX> n/ <NAME> p/ <PHONE> e/ <EMAIL> a/ <ADDRESS> j/ <JOB> i/ <INCOME> " | ||
+ "[t/ <TIER>] " | ||
+ "[t/ <TIER>] [s/ <STATUS>]" | ||
+ "[rn/ <NEW REMARK>] [ra/ <REMARK TO BE APPENDED ONTO EXISTING ONE>]", | ||
"edit 69 n/ TAN LESHEW p/ 77337733 e/ [email protected] a/ COM3 j/ doctor i/ 1000000000" | ||
"edit 69 n/ TAN LESHEW p/ 77337733 e/ [email protected] 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 <FLAG>/ <FLAG FIELD>", | ||
"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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch, i'll need to update this in the ug as well