use of com.intellij.analysis.BaseAnalysisActionDialog in project intellij-community by JetBrains.
the class RunInspectionIntention method selectScopeAndRunInspection.
public static void selectScopeAndRunInspection(@NotNull String toolShortName, @NotNull AnalysisScope customScope, @Nullable Module module, @Nullable PsiElement context, @NotNull Project project) {
final BaseAnalysisActionDialog dlg = new BaseAnalysisActionDialog(AnalysisScopeBundle.message("specify.analysis.scope", InspectionsBundle.message("inspection.action.title")), AnalysisScopeBundle.message("analysis.scope.title", InspectionsBundle.message("inspection.action.noun")), project, customScope, module != null ? module.getName() : null, true, AnalysisUIOptions.getInstance(project), context);
if (!dlg.showAndGet()) {
return;
}
final AnalysisUIOptions uiOptions = AnalysisUIOptions.getInstance(project);
customScope = dlg.getScope(uiOptions, customScope, project, module);
final InspectionToolWrapper wrapper = LocalInspectionToolWrapper.findTool2RunInBatch(project, context, toolShortName);
LOG.assertTrue(wrapper != null, "Can't find tool with name = \"" + toolShortName + "\"");
rerunInspection(wrapper, (InspectionManagerEx) InspectionManager.getInstance(project), customScope, context);
}
Aggregations