mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
inspection toolwindow: more granulating calls of read actions
This commit is contained in:
+1
-1
@@ -659,7 +659,7 @@ public class GlobalInspectionContextImpl extends GlobalInspectionContextBase imp
|
||||
}
|
||||
createViewIfNeed();
|
||||
if (!myView.isDisposed()) {
|
||||
ReadAction.run(() -> myView.addTools(globalTools));
|
||||
myView.addTools(globalTools);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,6 +39,7 @@ import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.application.ReadAction;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.*;
|
||||
import com.intellij.openapi.editor.colors.EditorColors;
|
||||
@@ -367,7 +368,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
|
||||
private JComponent createToolbar(final DefaultActionGroup specialGroup) {
|
||||
final ActionToolbar toolbar = ActionManager.getInstance().createActionToolbar(ActionPlaces.CODE_INSPECTION, specialGroup, false);
|
||||
toolbar.setTargetComponent(this);
|
||||
//toolbar.setTargetComponent(this);
|
||||
return toolbar.getComponent();
|
||||
}
|
||||
|
||||
@@ -670,7 +671,7 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
if (app.isUnitTestMode()) {
|
||||
buildAction.run();
|
||||
} else {
|
||||
app.executeOnPooledThread(() -> app.runReadAction(buildAction));
|
||||
app.executeOnPooledThread(buildAction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -721,12 +722,15 @@ public class InspectionResultsView extends JPanel implements Disposable, Occuren
|
||||
final HighlightDisplayKey key = HighlightDisplayKey.find(defaultToolWrapper.getShortName());
|
||||
for (ScopeToolState state : myProvider.getTools(currentTools)) {
|
||||
InspectionToolWrapper toolWrapper = state.getTool();
|
||||
if (myProvider.checkReportedProblems(myGlobalInspectionContext, toolWrapper)) {
|
||||
addTool(toolWrapper,
|
||||
profile.getErrorLevel(key, state.getScope(myProject), myProject),
|
||||
isGroupedBySeverity,
|
||||
singleInspectionRun);
|
||||
}
|
||||
LOG.assertTrue(!ApplicationManager.getApplication().isReadAccessAllowed());
|
||||
ReadAction.run(() -> {
|
||||
if (myProvider.checkReportedProblems(myGlobalInspectionContext, toolWrapper)) {
|
||||
addTool(toolWrapper,
|
||||
profile.getErrorLevel(key, state.getScope(myProject), myProject),
|
||||
isGroupedBySeverity,
|
||||
singleInspectionRun);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user