Search in sources :

Example 1 with IncludedXmlTag

use of com.intellij.xml.util.IncludedXmlTag in project intellij-community by JetBrains.

the class PluginDescriptorChooser method findOrCreateExtensionsForEP.

@NotNull
public static Extensions findOrCreateExtensionsForEP(DomFileElement<IdeaPlugin> domFileElement, String epName) {
    final IdeaPlugin ideaPlugin = domFileElement.getRootElement();
    final List<Extensions> extensionsList = ideaPlugin.getExtensions();
    for (Extensions extensions : extensionsList) {
        if (extensions.getXmlTag() instanceof IncludedXmlTag) {
            continue;
        }
        String s = extensions.getDefaultExtensionNs().getStringValue();
        if (s != null && epName.startsWith(s)) {
            return extensions;
        }
    }
    Extensions extensions = ideaPlugin.addExtensions();
    final String epPrefix = StringUtil.getPackageName(epName);
    extensions.getDefaultExtensionNs().setStringValue(epPrefix);
    return extensions;
}
Also used : IdeaPlugin(org.jetbrains.idea.devkit.dom.IdeaPlugin) IncludedXmlTag(com.intellij.xml.util.IncludedXmlTag) Extensions(org.jetbrains.idea.devkit.dom.Extensions) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

IncludedXmlTag (com.intellij.xml.util.IncludedXmlTag)1 NotNull (org.jetbrains.annotations.NotNull)1 Extensions (org.jetbrains.idea.devkit.dom.Extensions)1 IdeaPlugin (org.jetbrains.idea.devkit.dom.IdeaPlugin)1