String (InspectionTreeNode node) { if (node instanceof InspectionRootNode) { return "<b>'" + escapeNonBreakingSymbols(node) + "' project</b>"; } else if (node instanceof ProblemDescriptionNode) { final CommonProblemDescriptor descriptor = ((ProblemDescriptionNode)node).getDescriptor(); String warningLevelName = ""; String color = null; if (descriptor instanceof ProblemDescriptorBase) { InspectionToolWrapper<?, ?> tool = ((ProblemDescriptionNode)node).getToolWrapper(); HighlightDisplayKey key = HighlightDisplayKey.find(tool.getShortName()); HighlightSeverity severity = myProfile.getErrorLevel(key, ((ProblemDescriptorBase)descriptor).getStartElement()).getSeverity(); HighlightDisplayLevel level = HighlightDisplayLevel.find(severity); if (HighlightDisplayLevel.ERROR.equals(level)) { color = ERROR_COLOR; } else if (HighlightDisplayLevel.WARNING.equals(level)) { color = WARNING_COLOR; } warningLevelName = StringUtil.toUpperCase(level.getSeverity().getDisplayName()); } final StringBuilder sb = new StringBuilder(); sb.append("<span style=\"margin:1px;"); if (color != null) { sb.append("background:#"); sb.append(color); } sb.append("\">"); sb.append(warningLevelName); sb.append("</span>&nbsp;"); sb.append(escapeNonBreakingSymbols(node)); return sb.toString(); } else if (node instanceof RefElementNode) { String type = myManager.getType(Objects.requireNonNull(((RefElementNode)node).getElement())); return type + "&nbsp;<b>" + node.toString() + "</b>"; } else if (node instanceof InspectionNode) { return "<b>" + escapeNonBreakingSymbols(node) + "</b>&nbsp;inspection"; } else if (node instanceof InspectionGroupNode) { return "<b>" + escapeNonBreakingSymbols(node) + "</b>&nbsp;group"; } else { return escapeNonBreakingSymbols(node); } }