void (TemplateState state, Project project, Document document) { MyBasicUndoableAction undoableAction = new MyBasicUndoableAction(state, project, document); UndoManager.getInstance(project).undoableActionPerformed(undoableAction); Disposer.register(state, undoableAction); }