void (@NotNull AnActionEvent e) { final InspectionToolWrapper<?, ?> selectedTool = myPanel.getSelectedTool(); e.getPresentation().setEnabled( selectedTool != null && selectedTool.getMainToolId() != null && ContainerUtil.exists(InspectionProfileActionProvider.EP_NAME.getExtensionList(), actionProvider -> actionProvider.canDeleteInspection(getInspection(myPanel.getProfile(), selectedTool.getMainToolId()))) ); }