Search in sources :

Example 1 with AntDomAntlib

use of com.intellij.lang.ant.dom.AntDomAntlib in project intellij-community by JetBrains.

the class AntSupport method getAntLib.

@Nullable
public static AntDomAntlib getAntLib(PsiFile psiFile) {
    if (psiFile instanceof XmlFile) {
        final DomManager domManager = DomManager.getDomManager(psiFile.getProject());
        final DomFileElement<AntDomAntlib> fileElement = domManager.getFileElement((XmlFile) psiFile, AntDomAntlib.class);
        return fileElement != null ? fileElement.getRootElement() : null;
    }
    return null;
}
Also used : XmlFile(com.intellij.psi.xml.XmlFile) DomManager(com.intellij.util.xml.DomManager) AntDomAntlib(com.intellij.lang.ant.dom.AntDomAntlib) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

AntDomAntlib (com.intellij.lang.ant.dom.AntDomAntlib)1 XmlFile (com.intellij.psi.xml.XmlFile)1 DomManager (com.intellij.util.xml.DomManager)1 Nullable (org.jetbrains.annotations.Nullable)1