void (@NotNull AnActionEvent event) { Presentation presentation = event.getPresentation(); DataContext dataContext = event.getDataContext(); FileEditor editor = PlatformCoreDataKeys.FILE_EDITOR.getData(dataContext); UndoManager undoManager = getUndoManager(editor, dataContext, false); if (undoManager == null) { presentation.setEnabled(false); return; } presentation.setEnabled(isAvailable(editor, undoManager)); Pair<@NlsActions.ActionText String, @NlsActions.ActionDescription String> pair = getActionNameAndDescription(editor, undoManager); presentation.setText(pair.first); presentation.setDescription(pair.second); }