void (@NotNull AnActionEvent e) { Set<ServiceViewContributor> contributors = e.getData(ServiceViewActionUtils.CONTRIBUTORS_KEY); boolean isEnabled = false; if (contributors != null) { for (ServiceViewContributor contributor : contributors) { if (contributor instanceof RunDashboardServiceViewContributor) { isEnabled = true; break; } } } e.getPresentation().setEnabledAndVisible(isEnabled); }