package udo.logic.command;

import udo.logic.Logic;
import udo.util.Config.CommandName;

public class UndoCommand extends Command {
    public UndoCommand() {
        super();
        setCommandName(CommandName.UNDO);
    }

    @Override
    public boolean execute() {
        if (!super.execute()) {
            return false;
        }

        boolean isSuccessful = storage.undo();
        if (!isSuccessful) {
            setStatus(Logic.formatErrorStr(Logic.ERR_STORAGE));
        } else {
            gui.display(storage.query());
        }

        return isSuccessful;
    }
    
    @Override
    public boolean isValid() {
        return super.isValid();
    }

}
@@ -125,16 +125,169 @@
 mmand %7B%0A
+    private static final String STATUS_UNDO_COMPLETED = %22Undo completed%22;%0A    private static final String STATUS_NO_UNDO = %22no more operation to undo%22;%0A%0A
     publ
@@ -528,24 +528,25 @@
 age.undo();%0A
+%0A
         if (
@@ -609,25 +609,22 @@
 Str(
-Logic.ERR_STORAGE
+STATUS_NO_UNDO
 ));%0A
@@ -640,16 +640,62 @@
  else %7B%0A
+            setStatus(STATUS_UNDO_COMPLETED);%0A
         
@@ -731,32 +731,59 @@
 ());%0A        %7D%0A%0A
+        updateGUIStatus();%0A
         return i

Update status for undo