use of com.intellij.util.xml.highlighting.DomElementsProblemsHolder in project intellij-community by JetBrains.
the class BaseDomElementNode method doUpdate.
@Override
protected void doUpdate() {
if (!myDomElement.isValid())
return;
final Project project = myDomElement.getManager().getProject();
if (project.isDisposed())
return;
setUniformIcon(getNodeIcon());
clearColoredText();
final DomElementAnnotationsManager manager = DomElementAnnotationsManager.getInstance(project);
final DomElementsProblemsHolder holder = manager.getCachedProblemHolder(myDomElement);
final List<DomElementProblemDescriptor> problems = holder.getProblems(myDomElement, highlightIfChildrenHaveProblems(), HighlightSeverity.ERROR);
if (problems.size() > 0) {
final String toolTip = TooltipUtils.getTooltipText(problems);
addColoredFragment(getNodeName(), toolTip, getWavedAttributes(SimpleTextAttributes.STYLE_PLAIN));
if (isShowContainingFileInfo()) {
addColoredFragment(" (" + DomUtil.getFile(myDomElement).getName() + ")", toolTip, SimpleTextAttributes.GRAY_ATTRIBUTES);
}
} else if (myDomElement.getXmlTag() == null && !(myDomElement instanceof DomFileElement)) {
addColoredFragment(getNodeName(), folder ? SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES : SimpleTextAttributes.GRAYED_ATTRIBUTES);
} else if (folder) {
addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES);
final int childrenCount = getChildren().length;
addColoredFragment(" (" + childrenCount + ')', SimpleTextAttributes.GRAY_ATTRIBUTES);
} else {
addColoredFragment(getNodeName(), SimpleTextAttributes.REGULAR_ATTRIBUTES);
if (isShowContainingFileInfo()) {
addColoredFragment(" (" + DomUtil.getFile(myDomElement).getName() + ")", SimpleTextAttributes.GRAY_ATTRIBUTES);
}
}
}
Aggregations