package seedu.taskell.logic.commands;

import seedu.taskell.model.TaskManager;

/**
 * Clears the task manager.
 */
public class ClearCommand extends Command {

    public static final String COMMAND_WORD = "clear";
    public static final String MESSAGE_SUCCESS = "Task manager has been cleared!";

    public ClearCommand() {}


    @Override
    public CommandResult execute() {
        assert model != null;
        model.resetData(TaskManager.getEmptyTaskManager());
        return new CommandResult(MESSAGE_SUCCESS);
    }
}

@@ -32,16 +32,161 @@
 mands;%0A%0A
+import seedu.taskell.commons.core.EventsCenter;%0Aimport seedu.taskell.commons.events.ui.ClearCommandInputEvent;%0Aimport seedu.taskell.model.Model;%0A
 import s
@@ -408,40 +408,101 @@
  = %22
-Task manager has been cleared!%22;
+Clear command executed.%22;%0A    private static ClearCommand self;%0A%0A    public ClearCommand() %7B%7D
 %0A%0A  
@@ -502,32 +502,39 @@
  %7B%7D%0A%0A    public 
+static 
 ClearCommand() %7B
@@ -533,96 +533,425 @@
 mand
-() %7B%7D%0A%0A%0A    @Override%0A    public CommandResult execute() %7B%0A        assert model != null;
+ getInstance() %7B%0A        if (self == null) %7B%0A            self = new ClearCommand();%0A        %7D%0A        %0A        return self;%0A    %7D%0A%0A    @Override%0A    public CommandResult execute() %7B%0A        assert model != null;%0A        raiseClearCommandInputEvent();%0A        return new CommandResult(MESSAGE_SUCCESS);%0A    %7D%0A%0A    /** will be called from UiManager after confirmation of clear%0A     * */%0A    public void executeClear() %7B
 %0A   
@@ -1015,54 +1015,136 @@
     
+%7D%0A%0A
     
-return new CommandResult(MESSAGE_SUCCESS);
+private void raiseClearCommandInputEvent() %7B%0A        EventsCenter.getInstance().post(new ClearCommandInputEvent());      
 %0A   

edit ClearCommand to show dialog for confirm