Search in sources :

Example 1 with FtlXmlNamespaceType

use of com.intellij.freemarker.psi.files.FtlXmlNamespaceType in project intellij-plugins by JetBrains.

the class Struts2GlobalVariableProvider method installTaglibSupport.

private static void installTaglibSupport(@NotNull final List<FtlVariable> result, @NotNull final Module module, @NotNull @NonNls final String taglibUri, @NotNull @NonNls final String taglibPrefix) {
    final XmlFile xmlFile = JspManager.getInstance(module.getProject()).getTldFileByUri(taglibUri, module, null);
    if (xmlFile == null) {
        return;
    }
    final XmlDocument document = xmlFile.getDocument();
    if (document == null) {
        return;
    }
    final XmlNSDescriptor descriptor = (XmlNSDescriptor) document.getMetaData();
    if (descriptor == null) {
        return;
    }
    PsiElement declaration = descriptor.getDeclaration();
    if (declaration == null) {
        declaration = xmlFile;
    }
    result.add(new MyFtlLightVariable(taglibPrefix, declaration, new FtlXmlNamespaceType(descriptor)));
}
Also used : XmlFile(com.intellij.psi.xml.XmlFile) XmlNSDescriptor(com.intellij.xml.XmlNSDescriptor) XmlDocument(com.intellij.psi.xml.XmlDocument) FtlXmlNamespaceType(com.intellij.freemarker.psi.files.FtlXmlNamespaceType)

Aggregations

FtlXmlNamespaceType (com.intellij.freemarker.psi.files.FtlXmlNamespaceType)1 XmlDocument (com.intellij.psi.xml.XmlDocument)1 XmlFile (com.intellij.psi.xml.XmlFile)1 XmlNSDescriptor (com.intellij.xml.XmlNSDescriptor)1