use of com.intellij.psi.xml.XmlDocument in project intellij-plugins by JetBrains.
the class FlexSchemaHandler method getIllegalNamespaces.
private static Collection<String> getIllegalNamespaces(final XmlFile file) {
final XmlDocument document = file.getDocument();
final XmlTag rootTag = document == null ? null : document.getRootTag();
final String[] knownNamespaces = rootTag == null ? null : rootTag.knownNamespaces();
final Collection<String> illegalNamespaces = new ArrayList<>();
if (knownNamespaces != null) {
if (ArrayUtil.contains(JavaScriptSupportLoader.MXML_URI, knownNamespaces)) {
ContainerUtil.addAll(illegalNamespaces, MxmlJSClass.FLEX_4_NAMESPACES);
} else if (ArrayUtil.contains(JavaScriptSupportLoader.MXML_URI3, knownNamespaces)) {
illegalNamespaces.add(JavaScriptSupportLoader.MXML_URI);
}
}
return illegalNamespaces;
}
use of com.intellij.psi.xml.XmlDocument 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)));
}
Aggregations