void (@NotNull AnActionEvent e) { InspectionResultsView view = getView(e); InspectionToolWrapper<?, ?> wrapper = getToolWrapper(e); String shortName = Objects.requireNonNull(wrapper).getShortName(); if (Objects.requireNonNull(view).isSingleInspectionRun()) { view.getCurrentProfile().modifyProfile(it -> it.setToolEnabled(shortName, false)); } else { final RefEntity[] selectedElements = view.getTree().getSelectedElements(); final Set<PsiElement> files = new HashSet<>(); for (RefEntity selectedElement : selectedElements) { if (selectedElement instanceof RefElement) { files.add(((RefElement)selectedElement).getPsiElement()); } } if (files.isEmpty()) { view.getCurrentProfile().modifyProfile(it -> it.setToolEnabled(shortName, false)); } else { InspectionProfileModifiableModelKt.modifyAndCommitProjectProfile(view.getProject(), it -> { for (PsiElement element : files) { it.disableTool(shortName, element); } }); } } }