use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class ActionLinkReferenceProviderTest method checkActionReference.
/**
* Checks the Action-reference.
*
* @param filename File to check.
* @param actionName Name of the Action to resolve to.
* @throws Throwable On errors.
*/
private void checkActionReference(@NonNls final String filename, @NonNls final String actionName) {
final PsiReference psiReference = myFixture.getReferenceAtCaretPositionWithAssertion(filename);
final PsiElement psiElement = psiReference.resolve();
assertNotNull("no resolve element " + actionName, psiElement);
assertTrue(psiElement instanceof XmlTag);
final DomElement actionElement = DomManager.getDomManager(getProject()).getDomElement((XmlTag) psiElement);
assertNotNull(actionElement);
assertInstanceOf(actionElement, Action.class);
assertEquals("Action name differs for " + actionName, actionName, ((Action) actionElement).getName().getStringValue());
}
use of com.intellij.util.xml.DomElement in project intellij-plugins by JetBrains.
the class StructureViewTreeElement method getTextAttributesKey.
/**
* Highlight invalid elements with red underwave.
*
* @return null if no errors.
*/
@Nullable
@Override
public TextAttributesKey getTextAttributesKey() {
final DomElement element = getElement();
if (!element.isValid()) {
return null;
}
final XmlTag tag = element.getXmlTag();
if (tag == null) {
return null;
}
final DomElementsProblemsHolder holder = DomElementAnnotationsManager.getInstance(tag.getProject()).getCachedProblemHolder(element);
final List<DomElementProblemDescriptor> problems = holder.getProblems(element, true, HighlightSeverity.ERROR);
if (!problems.isEmpty()) {
return CodeInsightColors.ERRORS_ATTRIBUTES;
}
return null;
}
Aggregations