diff options
Diffstat (limited to 'platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java')
-rw-r--r-- | platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java index 432ef560ba58..117cd774dff8 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/filter/InspectionsFilter.java @@ -33,11 +33,16 @@ public abstract class InspectionsFilter { private final Set<HighlightSeverity> mySuitableSeverities = new HashSet<HighlightSeverity>(); private Boolean mySuitableInspectionsStates; private boolean myAvailableOnlyForAnalyze; + private boolean myShowOnlyCleanupInspections; public boolean isAvailableOnlyForAnalyze() { return myAvailableOnlyForAnalyze; } + public boolean isShowOnlyCleanupInspections() { + return myShowOnlyCleanupInspections; + } + public Boolean getSuitableInspectionsStates() { return mySuitableInspectionsStates; } @@ -46,6 +51,11 @@ public abstract class InspectionsFilter { return mySuitableSeverities.contains(severity); } + public void setShowOnlyCleanupInspections(final boolean showOnlyCleanupInspections) { + myShowOnlyCleanupInspections = showOnlyCleanupInspections; + filterChanged(); + } + public void setAvailableOnlyForAnalyze(final boolean availableOnlyForAnalyze) { myAvailableOnlyForAnalyze = availableOnlyForAnalyze; filterChanged(); @@ -67,10 +77,17 @@ public abstract class InspectionsFilter { } public boolean isEmptyFilter() { - return mySuitableInspectionsStates == null && !myAvailableOnlyForAnalyze && mySuitableSeverities.isEmpty(); + return mySuitableInspectionsStates == null + && !myAvailableOnlyForAnalyze + && !myShowOnlyCleanupInspections + && mySuitableSeverities.isEmpty(); } public boolean matches(final Tools tools) { + if (myShowOnlyCleanupInspections && !tools.getTool().isCleanupTool()) { + return false; + } + if (mySuitableInspectionsStates != null && mySuitableInspectionsStates != tools.isEnabled()) { return false; } |