use of org.jetbrains.idea.devkit.dom.IdeaPlugin 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;
}
use of org.jetbrains.idea.devkit.dom.IdeaPlugin in project intellij-community by JetBrains.
the class ExtensionsImpl method getEpPrefix.
@NotNull
public String getEpPrefix() {
String prefix = getDefaultExtensionNs().getStringValue();
if (prefix == null) {
final IdeaPlugin ideaPlugin = getParentOfType(IdeaPlugin.class, true);
prefix = ideaPlugin == null ? null : StringUtil.notNullize(ideaPlugin.getPluginId(), DEFAULT_PREFIX);
}
if (prefix == null)
prefix = getXmlns().getStringValue();
return prefix != null ? prefix + "." : "";
}
use of org.jetbrains.idea.devkit.dom.IdeaPlugin in project intellij-community by JetBrains.
the class IdeaPluginConverter method getAllPluginsWithoutSelf.
private static Collection<IdeaPlugin> getAllPluginsWithoutSelf(final ConvertContext context) {
final IdeaPlugin self = context.getInvocationElement().getParentOfType(IdeaPlugin.class, true);
if (self == null)
return Collections.emptyList();
final Collection<IdeaPlugin> plugins = getAllPlugins(context.getProject());
return ContainerUtil.filter(plugins, plugin -> !Comparing.strEqual(self.getPluginId(), plugin.getPluginId()));
}
use of org.jetbrains.idea.devkit.dom.IdeaPlugin in project intellij-community by JetBrains.
the class DescriptorUtil method getPluginId.
@Nullable
public static String getPluginId(Module plugin) {
assert PluginModuleType.isOfType(plugin);
final XmlFile pluginXml = PluginModuleType.getPluginXml(plugin);
if (pluginXml == null) {
return null;
}
final DomFileElement<IdeaPlugin> ideaPlugin = getIdeaPlugin(pluginXml);
if (ideaPlugin == null) {
return null;
}
return ideaPlugin.getRootElement().getPluginId();
}
Aggregations