コード例 #1
0
ファイル: MCmdOpEnter.java プロジェクト: stormymauldin/stuff
  /**
   * Undo effect of command.
   *
   * @exception CannotUndoException if the command cannot be undone or has not been executed before.
   */
  public void undo() throws CannotUndoException {
    // the CommandProcessor should prevent us from being called
    // without a successful prior execute, just be safe here
    MSystem system = fSystemState.system();
    if (system.activeOperation() != fOpCall) throw new CannotUndoException("no undo information");

    system.popOperation();
    system.setCurrentState(fSystemState);
  }
コード例 #2
0
ファイル: MCmdOpEnter.java プロジェクト: stormymauldin/stuff
 /**
  * Executes command and stores undo information.
  *
  * @exception CommandFailedException if the command failed.
  */
 public void execute() throws CommandFailedException {
   fSystemState.system().enterOperation(fOpCall, new PrintWriter(Log.out()));
 }