Skip to content
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

Abstract display string to its own method #271

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/seedu/address/ui/MainWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void fillInnerParts() {

noteDisplay = new NoteDisplay();
patientDetailsPlaceholder.getChildren().add(noteDisplay.getRoot());
noteDisplay.setNoteToUser(logic.getDisplayedNote().value);
noteDisplay.setNoteToUser(logic.getDisplayedNote());

StatusBarFooter statusBarFooter = new StatusBarFooter(logic.getAddressBookFilePath());
statusbarPlaceholder.getChildren().add(statusBarFooter.getRoot());
Expand Down Expand Up @@ -185,7 +185,7 @@ private CommandResult executeCommand(String commandText) throws CommandException
CommandResult commandResult = logic.execute(commandText);
logger.info("Result: " + commandResult.getFeedbackToUser());
resultDisplay.setFeedbackToUser(commandResult.getFeedbackToUser());
noteDisplay.setNoteToUser(logic.getDisplayedNote().value);
noteDisplay.setNoteToUser(logic.getDisplayedNote());

if (commandResult.isShowHelp()) {
handleHelp();
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/seedu/address/ui/NoteDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import javafx.fxml.FXML;
import javafx.scene.control.TextArea;
import javafx.scene.layout.Region;
import seedu.address.model.person.Note;


/**
Expand All @@ -19,7 +20,7 @@ public NoteDisplay() {
super(FXML);
}

public void setNoteToUser(String noteToUser) {
noteDisplay.setText(noteToUser);
public void setNoteToUser(Note noteToUser) {
noteDisplay.setText(noteToUser.getDisplayString());
}
}
Loading