void (@NotNull AnActionEvent event) { super.update(event); Presentation presentation = event.getPresentation(); Project project = event.getProject(); if (project == null) { presentation.setEnabled(false); return; } ToolWindowManager mgr=ToolWindowManager.getInstance(project); String id=mgr.getActiveToolWindowId(); presentation.setEnabled(id!=null&&mgr.getToolWindow(id).isAvailable()); }