mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-210863 Remove icons from group nodes, compute proper icons depending on actual severities.
GitOrigin-RevId: e8d5c616a55498934aff3ecc7884a313024d3642
This commit is contained in:
committed by
intellij-monorepo-bot
parent
20332b40d7
commit
4c9bed94ed
+21
-12
@@ -29,6 +29,7 @@ import com.intellij.ui.treeStructure.treetable.TreeTableTree;
|
||||
import com.intellij.util.Alarm;
|
||||
import com.intellij.util.NullableFunction;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.ui.EmptyIcon;
|
||||
import com.intellij.util.ui.TextTransferable;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.table.IconTableCellRenderer;
|
||||
@@ -276,15 +277,20 @@ public class InspectionsConfigTreeTable extends TreeTable {
|
||||
final InspectionConfigTreeNode treeNode = (InspectionConfigTreeNode)node;
|
||||
final List<HighlightDisplayKey> inspectionsKeys = InspectionsAggregationUtil.getInspectionsKeys(treeNode);
|
||||
if (column == SEVERITIES_COLUMN) {
|
||||
final MultiColoredHighlightSeverityIconSink sink = new MultiColoredHighlightSeverityIconSink();
|
||||
for (final HighlightDisplayKey selectedInspectionsNode : inspectionsKeys) {
|
||||
final String toolId = selectedInspectionsNode.toString();
|
||||
if (mySettings.getInspectionProfile().getTools(toolId, mySettings.getProject()).isEnabled()) {
|
||||
sink.put(mySettings.getInspectionProfile().getToolDefaultState(toolId, mySettings.getProject()),
|
||||
mySettings.getInspectionProfile().getNonDefaultTools(toolId, mySettings.getProject()));
|
||||
if (treeNode instanceof InspectionConfigTreeNode.Group) {
|
||||
return EmptyIcon.ICON_0;
|
||||
}
|
||||
else {
|
||||
final MultiColoredHighlightSeverityIconSink sink = new MultiColoredHighlightSeverityIconSink();
|
||||
for (final HighlightDisplayKey selectedInspectionsNode : inspectionsKeys) {
|
||||
final String toolId = selectedInspectionsNode.toString();
|
||||
if (mySettings.getInspectionProfile().getTools(toolId, mySettings.getProject()).isEnabled()) {
|
||||
sink.put(mySettings.getInspectionProfile().getToolDefaultState(toolId, mySettings.getProject()),
|
||||
mySettings.getInspectionProfile().getNonDefaultTools(toolId, mySettings.getProject()));
|
||||
}
|
||||
}
|
||||
return sink.constructIcon(mySettings.getInspectionProfile());
|
||||
}
|
||||
return sink.constructIcon(mySettings.getInspectionProfile());
|
||||
}
|
||||
if (column == IS_ENABLED_COLUMN) {
|
||||
return isEnabled(inspectionsKeys);
|
||||
@@ -439,11 +445,12 @@ public class InspectionsConfigTreeTable extends TreeTable {
|
||||
}
|
||||
|
||||
boolean allScopesHasMixedSeverity = true;
|
||||
boolean allErrors = true;
|
||||
boolean hasError = false;
|
||||
for (HighlightSeverity severity : computedSeverities.values()) {
|
||||
if (!severity.equals(ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY)) {
|
||||
allScopesHasMixedSeverity = false;
|
||||
break;
|
||||
}
|
||||
allScopesHasMixedSeverity = allScopesHasMixedSeverity && severity.equals(ScopesAndSeveritiesTable.MIXED_FAKE_SEVERITY);
|
||||
hasError = hasError || severity.equals(HighlightSeverity.ERROR);
|
||||
allErrors = allErrors && severity.equals(HighlightSeverity.ERROR);
|
||||
}
|
||||
|
||||
if (allScopesHasMixedSeverity) {
|
||||
@@ -455,7 +462,9 @@ public class InspectionsConfigTreeTable extends TreeTable {
|
||||
return HighlightDisplayLevel.find(severity).getIcon();
|
||||
}
|
||||
else {
|
||||
return AllIcons.General.InspectionsMixed;
|
||||
return allErrors ? HighlightDisplayLevel.ERROR.getIcon() :
|
||||
hasError ? AllIcons.General.InspectionsMixed:
|
||||
HighlightDisplayLevel.WARNING.getIcon();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user