void (@NotNull final AnActionEvent e) { final Presentation presentation = e.getPresentation(); final GuiEditor editor = FormEditingUtil.getEditorFromContext(e.getDataContext()); if (editor == null) { presentation.setEnabled(false); return; } final SelectionState selectionState = editor.getSelectionState(); selectionState.setInsideChange(true); final Stack<ComponentPtr[]> history = selectionState.getSelectionHistory(); presentation.setEnabled(!history.isEmpty()); }