void (@NotNull AnActionEvent e) { Project project = e.getProject(); ComponentItem selectedItem = e.getData(ComponentItem.DATA_KEY); GroupItem groupItem = e.getData(GroupItem.DATA_KEY); e.getPresentation().setEnabled(project != null && selectedItem != null && groupItem != null && !selectedItem.isAnyComponent() && selectedItem.isRemovable()); }