inspection toolwindow: remove redundant "is single run" detection way
authorDmitry Batkovich <batya239@gmail.com>
Fri, 3 Jun 2016 17:56:54 +0000 (20:56 +0300)
committerDmitry Batkovich <batya239@gmail.com>
Fri, 3 Jun 2016 17:56:54 +0000 (20:56 +0300)
platform/lang-impl/src/com/intellij/codeInspection/actions/RunInspectionIntention.java
platform/lang-impl/src/com/intellij/codeInspection/ex/GlobalInspectionContextImpl.java
platform/lang-impl/src/com/intellij/codeInspection/ui/InspectionResultsView.java

index 4b57ed02b12c06b45dac41e80b3e3ffbd1069899..5f92525225169038e47f04014175b9478af49189 100644 (file)
@@ -147,7 +147,6 @@ public class RunInspectionIntention implements IntentionAction, HighPriorityActi
     model.setEditable(toolWrapper.getDisplayName());
     final GlobalInspectionContextImpl inspectionContext = managerEx.createNewGlobalContext(false);
     inspectionContext.setExternalProfile(model);
-    inspectionContext.setSingleInspectionRun(true);
     return inspectionContext;
   }
 
index 607b55e0b4aabdf0c703ea59643a3dda8018e3c4..7081deb07333a415b4cd12ab217aa8788021f0fa 100644 (file)
@@ -98,7 +98,6 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
   private volatile InspectionResultsView myView;
   private Content myContent;
   private volatile boolean myViewClosed = true;
-  private volatile boolean mySingleInspectionRun;
 
   @NotNull
   private AnalysisUIOptions myUIOptions;
@@ -156,7 +155,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
   public void addView(@NotNull InspectionResultsView view) {
     addView(view, view.getCurrentProfileName() == null
                   ? InspectionsBundle.message("inspection.results.title")
-                  : InspectionsBundle.message(mySingleInspectionRun ?
+                  : InspectionsBundle.message(!getCurrentProfile().isEditable() ?
                                               "inspection.results.for.inspection.toolwindow.title" :
                                               "inspection.results.for.profile.toolwindow.title",
                                               view.getCurrentProfileName(), getCurrentScope().getShortenName()), false);
@@ -977,14 +976,6 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
     return myViewClosed;
   }
 
-  public void setSingleInspectionRun(boolean singleInspectionRun) {
-    mySingleInspectionRun = singleInspectionRun;
-  }
-
-  public boolean isSingleInspectionRun() {
-    return mySingleInspectionRun;
-  }
-
   private InspectionRVContentProvider createContentProvider() {
     return new InspectionRVContentProviderImpl(getProject());
   }
index f77074eb1b8088ac02ffd68bb1faf4951d247453..a560beeb0dc292049d6efdb41ce91bfd280224ba 100644 (file)
@@ -145,7 +145,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
     myGlobalInspectionContext = globalInspectionContext;
     myProvider = provider;
     myExcludedInspectionTreeNodesManager = new ExcludedInspectionTreeNodesManager(provider instanceof OfflineInspectionRVContentProvider,
-                                                                                  globalInspectionContext.isSingleInspectionRun());
+                                                                                  !myInspectionProfile.isEditable());
 
     myTree = new InspectionTree(myProject, globalInspectionContext, this);
     initTreeListeners();
@@ -696,7 +696,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
     synchronized (myTreeStructureUpdateLock) {
       InspectionProfileImpl profile = (InspectionProfileImpl)myInspectionProfile;
       boolean isGroupedBySeverity = myGlobalInspectionContext.getUIOptions().GROUP_BY_SEVERITY;
-      boolean singleInspectionRun = myGlobalInspectionContext.isSingleInspectionRun();
+      boolean singleInspectionRun = !myInspectionProfile.isEditable();
       for (Tools currentTools : tools) {
         InspectionToolWrapper defaultToolWrapper = currentTools.getDefaultState().getTool();
         if (myGlobalInspectionContext.getUIOptions().FILTER_RESOLVED_ITEMS &&