RunCurrentFileActionStatus (@NotNull PsiFile psiFile, boolean resetCache, @NotNull AnActionEvent e) { List<RunnerAndConfigurationSettings> runConfigs = getRunConfigsForCurrentFile(psiFile, resetCache); if (runConfigs.isEmpty()) { String tooltip = ExecutionBundle.message("run.button.on.toolbar.tooltip.current.file.not.runnable"); return RunCurrentFileActionStatus.createDisabled(tooltip, myExecutor.getIcon()); } List<RunnerAndConfigurationSettings> runnableConfigs = filterConfigsThatHaveRunner(runConfigs); if (runnableConfigs.isEmpty()) { return RunCurrentFileActionStatus.createDisabled(myExecutor.getStartActionText(psiFile.getName()), myExecutor.getIcon()); } Icon icon = myExecutor.getIcon(); if (runnableConfigs.size() == 1) { icon = getInformativeIcon(psiFile.getProject(), runnableConfigs.get(0), e); } else { // myExecutor.getIcon() is the least preferred icon // AllIcons.Actions.Restart is more preferred // Other icons are the most preferred ones (like ExecutionUtil.getLiveIndicator()) for (RunnerAndConfigurationSettings config : runnableConfigs) { Icon anotherIcon = getInformativeIcon(psiFile.getProject(), config, e); if (icon == myExecutor.getIcon() || (anotherIcon != myExecutor.getIcon() && anotherIcon != AllIcons.Actions.Restart)) { icon = anotherIcon; } } } return RunCurrentFileActionStatus.createEnabled(myExecutor.getStartActionText(psiFile.getName()), icon, runnableConfigs); }