diff --git a/src/main/java/seedu/address/logic/commands/AbstractFindCommand.java b/src/main/java/seedu/address/logic/commands/AbstractFindCommand.java index b7d9b2b2983..b5e469f2d62 100644 --- a/src/main/java/seedu/address/logic/commands/AbstractFindCommand.java +++ b/src/main/java/seedu/address/logic/commands/AbstractFindCommand.java @@ -42,6 +42,12 @@ protected ContainsKeywordsPredicate getPredicate() { public CommandResult execute(Model model) { requireNonNull(model); model.updateFilteredPersonList(this.predicate); + + // if the result find list is empty + if (model.getFilteredPersonList().isEmpty()) { + return new CommandResult(String.format("No persons found!")); + } + return new CommandResult( String.format(Messages.MESSAGE_PERSONS_LISTED_OVERVIEW, model.getFilteredPersonList().size())); } diff --git a/src/main/java/seedu/address/logic/commands/DeleteCommand.java b/src/main/java/seedu/address/logic/commands/DeleteCommand.java index 1135ac19b74..903678c8ca9 100644 --- a/src/main/java/seedu/address/logic/commands/DeleteCommand.java +++ b/src/main/java/seedu/address/logic/commands/DeleteCommand.java @@ -42,7 +42,12 @@ public CommandResult execute(Model model) throws CommandException { Person personToDelete = lastShownList.get(targetIndex.getZeroBased()); model.deletePerson(personToDelete); - return new CommandResult(String.format(MESSAGE_DELETE_PERSON_SUCCESS, Messages.format(personToDelete))); + + String result = String.format(MESSAGE_DELETE_PERSON_SUCCESS, personToDelete); + if (model.getFilteredPersonList().isEmpty()) { + result += "\nThe contact list is empty! :("; + } + return new CommandResult(result); } @Override diff --git a/src/main/java/seedu/address/ui/MainWindow.java b/src/main/java/seedu/address/ui/MainWindow.java index a61d11cd688..0d5b4d859ad 100644 --- a/src/main/java/seedu/address/ui/MainWindow.java +++ b/src/main/java/seedu/address/ui/MainWindow.java @@ -115,6 +115,9 @@ void fillInnerParts() { resultDisplay = new ResultDisplay(); resultDisplayPlaceholder.getChildren().add(resultDisplay.getRoot()); + if (logic.getFilteredPersonList().isEmpty()) { + resultDisplay.setFeedbackToUser("The contact list is empty! :("); + } StatusBarFooter statusBarFooter = new StatusBarFooter(logic.getCampusConnectFilePath()); statusbarPlaceholder.getChildren().add(statusBarFooter.getRoot()); diff --git a/src/main/resources/view/PersonListCard.fxml b/src/main/resources/view/PersonListCard.fxml index c6f33eb1e2f..f672f6ab9fa 100644 --- a/src/main/resources/view/PersonListCard.fxml +++ b/src/main/resources/view/PersonListCard.fxml @@ -29,7 +29,6 @@