void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Component component = e.getData(PlatformCoreDataKeys.CONTEXT_COMPONENT); boolean notForTheOnlyContent = myManager.getContentCount() > 1 || !(component instanceof ContentTabLabel); presentation.setEnabledAndVisible(notForTheOnlyContent && myManager.canCloseAllContents()); }