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

Add ClearNoteCommand #152

Merged
merged 30 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
f03339c
Merge pull request #2 from AY1920S1-CS2103T-F12-3/master
shiweing Sep 30, 2019
59b651d
Merge pull request #3 from AY1920S1-CS2103T-F12-3/master
shiweing Sep 30, 2019
7133161
Merge pull request #4 from AY1920S1-CS2103T-F12-3/master
shiweing Sep 30, 2019
7acba76
Add changes from team repo (#5)
shiweing Sep 30, 2019
d6dd340
Merge pull request #6 from from AY1920S1-CS2103T-F12-3/master
shiweing Oct 3, 2019
1e6da83
Merge and resolve conflicts from upstream
shiweing Oct 3, 2019
e0a4438
Add newline after EOF for README and AboutUs
shiweing Oct 3, 2019
beda0a8
Merge pull request #9 from AY1920S1-CS2103T-F12-3/main
shiweing Oct 3, 2019
7f7a6f7
Fix Yehez image name
shiweing Oct 3, 2019
aebd5fd
Merge PR #10 from AY1920S1-CS2103T-F12-3/main
shiweing Oct 8, 2019
72ed368
Updates from upstream (#14)
shiweing Oct 13, 2019
8f6c38b
Fix merge conflict
shiweing Oct 17, 2019
a6665fd
Fix merge conflicts from upstream
shiweing Oct 17, 2019
3fa5eb6
Fix merge conflicts
shiweing Oct 17, 2019
ff2154d
Merge remote-tracking branch 'upstream/master'
shiweing Oct 17, 2019
feca022
Fix merge conflict from pulling from upstream
shiweing Oct 18, 2019
49b4ac9
Add missing files to master from upstream
shiweing Oct 19, 2019
ade641a
Remove dummy view
shiweing Oct 19, 2019
4fd3ea2
Merge updates from AY1920S1-CS2103T-F12-3/main (#18)
shiweing Oct 21, 2019
ed17406
Updates from upstream (#19)
shiweing Oct 23, 2019
e294c64
Fix NoteBook.java for duplicate findNote()
shiweing Oct 23, 2019
c0aeed8
Fix merge conflict from upstream
shiweing Oct 24, 2019
bc107cb
Updates from upstream (#21)
shiweing Oct 24, 2019
7b5499d
Merge updates from upstream
shiweing Oct 25, 2019
39b8fdc
Merge updates from AY1920S1-CS2103T-F12-3/main
shiweing Oct 29, 2019
8fb3fd2
Merge pull request #24 from AY1920S1-CS2103T-F12-3/master
shiweing Oct 29, 2019
43296af
Merge pull request #25 from AY1920S1-CS2103T-F12-3/master
shiweing Oct 30, 2019
830f549
Merge pull request #26 from AY1920S1-CS2103T-F12-3/master
shiweing Oct 30, 2019
440f54c
Add ClearNoteCommand
shiweing Oct 30, 2019
15347d1
Add authorship
shiweing Oct 30, 2019
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
23 changes: 23 additions & 0 deletions src/main/java/tagline/logic/commands/note/ClearNoteCommand.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// @@author shiweing
package tagline.logic.commands.note;

import static java.util.Objects.requireNonNull;

import tagline.logic.commands.CommandResult;
import tagline.model.Model;
import tagline.model.note.NoteBook;

/**
* Clears the note book.
*/
public class ClearNoteCommand extends NoteCommand {
public static final String COMMAND_WORD = "clear";
public static final String MESSAGE_SUCCESS = "Notes have been cleared!";

@Override
public CommandResult execute(Model model) {
requireNonNull(model);
model.setNoteBook(new NoteBook());
return new CommandResult(MESSAGE_SUCCESS, CommandResult.ViewType.NOTE);
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static java.util.Objects.requireNonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static java.util.Objects.requireNonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static java.util.Objects.requireNonNull;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tagline/logic/commands/note/NoteCommand.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import tagline.logic.commands.Command;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static java.util.Objects.requireNonNull;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/tagline/logic/parser/note/NoteCliSyntax.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import tagline.logic.parser.Prefix;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand All @@ -8,6 +9,7 @@

import tagline.logic.commands.Command;
import tagline.logic.commands.HelpCommand;
import tagline.logic.commands.note.ClearNoteCommand;
import tagline.logic.commands.note.CreateNoteCommand;
import tagline.logic.commands.note.DeleteNoteCommand;
import tagline.logic.commands.note.EditNoteCommand;
Expand Down Expand Up @@ -52,6 +54,9 @@ public Command parseCommand(String userInput) throws ParseException {
case ListNoteCommand.COMMAND_WORD:
return new ListNoteParser().parse(arguments);

case ClearNoteCommand.COMMAND_WORD:
return new ClearNoteCommand();

default:
throw new ParseException(MESSAGE_UNKNOWN_COMMAND);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static java.util.Objects.requireNonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static java.util.Objects.requireNonNull;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static org.junit.jupiter.api.Assertions.assertTrue;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.commands.note;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.commons.core.Messages.MESSAGE_INVALID_COMMAND_FORMAT;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static org.junit.jupiter.api.Assertions.assertEquals;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @@author shiweing
package tagline.logic.parser.note;

import static tagline.logic.parser.note.NoteParserUtil.MESSAGE_INVALID_INDEX;
Expand Down