void (@NotNull AnActionEvent e) { Presentation presentation = e.getPresentation(); Project project = e.getData(CommonDataKeys.PROJECT); if (project == null || project.isDefault() || project.isDisposed()) { presentation.setEnabledAndVisible(false); presentation.setText(""); presentation.setIcon(null); } else if (e.isFromActionToolbar()) { TaskManager taskManager = TaskManager.getManager(project); LocalTask activeTask = taskManager.getActiveTask(); if (isTaskManagerComboInToolbarEnabledAndVisible(activeTask, taskManager)) { String s = getText(activeTask); presentation.setEnabledAndVisible(true); presentation.setText(s, false); presentation.setIcon(activeTask.getIcon()); presentation.setDescription(activeTask.getSummary()); } else { presentation.setEnabledAndVisible(false); } } else { presentation.setEnabledAndVisible(true); presentation.copyFrom(getTemplatePresentation()); } }