void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getProject(); if (project == null) { presentation.setEnabled(false); return; } ToolWindowManager windowManager = ToolWindowManager.getInstance(project); String id = windowManager.getActiveToolWindowId(); presentation.setEnabled(ToolWindowId.COMMANDER.equals(id)); }