void (@NotNull DataContext dataContext) { List<ConfigurationType> targetTypes = getTargetTypes(dataContext); if (targetTypes.isEmpty()) { if (myDelegate != null) { myDelegate.deleteElement(dataContext); } return; } Project project = dataContext.getData(CommonDataKeys.PROJECT); if (project == null) return; ConfigurationType onlyType = ContainerUtil.getOnlyItem(targetTypes); String message; if (onlyType != null) { message = ExecutionBundle.message("run.dashboard.remove.run.configuration.type.confirmation", onlyType.getDisplayName()); } else { message = ExecutionBundle.message("run.dashboard.remove.run.configuration.types.confirmation", targetTypes.size()); } if (!MessageDialogBuilder.yesNo(IdeBundle.message("button.remove"), message) .yesText(IdeBundle.message("button.remove")) .icon(Messages.getWarningIcon()) .ask(project)) { return; } RunDashboardManager runDashboardManager = RunDashboardManager.getInstance(project); Set<String> types = new HashSet<>(runDashboardManager.getTypes()); for (ConfigurationType type : targetTypes) { types.remove(type.getId()); } runDashboardManager.setTypes(types); }