private void undoOrRedo(boolean isUndo) throws UnexpectedUndoException {
    if (LOG.isDebugEnabled()) {
      LOG.debug("Performing " + (isUndo ? "undo" : "redo") + " for " + dumpState());
    }
    LocalHistoryAction action;
    if (myProject != null && isGlobal()) {
      String actionName = IdeBundle.message(isUndo ? "undo.command" : "redo.command", myCommandName);
      action = LocalHistory.getInstance().startAction(actionName);
    }
    else {
      action = LocalHistoryAction.NULL;
    }

    try {
      doUndoOrRedo(isUndo);
    }
    finally {
      action.finish();
    }
  }
private void undoOrRedo(boolean isUndo)