Skip to content

Commit

Permalink
fix message for schedule/undo
Browse files Browse the repository at this point in the history
  • Loading branch information
rachx committed Oct 19, 2016
1 parent f55ab6f commit f6522c6
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/main/java/seedu/agendum/logic/commands/ScheduleCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
public class ScheduleCommand extends Command {

public static final String COMMAND_WORD = "schedule";
public static String COMMAND_FORMAT = "schedule <name> \nschedule <name> by <deadline> \nschedule <name> from <start-time> to <end-time>";
public static String COMMAND_DESCRIPTION = "update the time of a task";

public static final String MESSAGE_USAGE = COMMAND_WORD + ": Re-schedule an existing task. "
+ "Parameters: INDEX (must be a positive number) [new deadline/start/end time]\n"
Expand All @@ -29,6 +31,13 @@ public class ScheduleCommand extends Command {
private final Optional<LocalDateTime> newStartDateTime;
private final Optional<LocalDateTime> newEndDateTime;

//temporary for message
public ScheduleCommand() {
this.targetIndex = 0;
this.newStartDateTime = null;
this.newEndDateTime = null;
}

/**
* New task has no time specification
*/
Expand Down Expand Up @@ -66,4 +75,19 @@ public CommandResult execute() {
}
}

@Override
public String getName() {
return COMMAND_WORD;
}

@Override
public String getFormat() {
return COMMAND_FORMAT;
}

@Override
public String getDescription() {
return COMMAND_DESCRIPTION;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class UndoCommand extends Command {

public static final String COMMAND_WORD = "undo";
public static String COMMAND_FORMAT = "undo";
public static String COMMAND_DESCRIPTION = "undo the previous command(s) that has changed the task list";
public static String COMMAND_DESCRIPTION = "undo the previous command(s)";
public static final String MESSAGE_SUCCESS = "Previous command undone!";
public static final String MESSAGE_FAILURE = "Nothing to undo!";

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/seedu/agendum/ui/HelpWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import seedu.agendum.logic.commands.ListCommand;
import seedu.agendum.logic.commands.MarkCommand;
import seedu.agendum.logic.commands.RenameCommand;
import seedu.agendum.logic.commands.ScheduleCommand;
import seedu.agendum.logic.commands.UndoCommand;
import seedu.agendum.logic.commands.UnmarkCommand;
import seedu.agendum.commons.core.LogsCenter;
Expand Down Expand Up @@ -140,6 +141,7 @@ public void handle(KeyEvent evt) {
private void loadHelpList() {
commandList.add(new AddCommand());
commandList.add(new RenameCommand());
commandList.add(new ScheduleCommand());
commandList.add(new MarkCommand(new HashSet<Integer>()));
commandList.add(new UnmarkCommand(new HashSet<Integer>()));
commandList.add(new DeleteCommand(new HashSet<Integer>()));
Expand Down

0 comments on commit f6522c6

Please sign in to comment.