Search in sources :

Example 6 with BaseAnalysisActionDialog

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);
}
Also used : AnalysisUIOptions(com.intellij.analysis.AnalysisUIOptions) BaseAnalysisActionDialog(com.intellij.analysis.BaseAnalysisActionDialog)

Aggregations

BaseAnalysisActionDialog (com.intellij.analysis.BaseAnalysisActionDialog)6 AnalysisScope (com.intellij.analysis.AnalysisScope)5 AnalysisUIOptions (com.intellij.analysis.AnalysisUIOptions)5 Module (com.intellij.openapi.module.Module)5 Project (com.intellij.openapi.project.Project)3 CleanupLocalInspectionTool (com.intellij.codeInspection.CleanupLocalInspectionTool)1 InspectionProfile (com.intellij.codeInspection.InspectionProfile)1 InspectionManagerEx (com.intellij.codeInspection.ex.InspectionManagerEx)1 InspectionProfileImpl (com.intellij.codeInspection.ex.InspectionProfileImpl)1 InspectionToolWrapper (com.intellij.codeInspection.ex.InspectionToolWrapper)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 TitledSeparator (com.intellij.ui.TitledSeparator)1 ActionEvent (java.awt.event.ActionEvent)1 ArrayList (java.util.ArrayList)1 NotNull (org.jetbrains.annotations.NotNull)1 Nullable (org.jetbrains.annotations.Nullable)1