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(); if(id==null){ presentation.setEnabled(false); return; } ToolWindow toolWindow=mgr.getToolWindow(id); presentation.setEnabled(toolWindow.isAvailable() && toolWindow.getType() != ToolWindowType.FLOATING && toolWindow.getType() != ToolWindowType.WINDOWED); }