ExtensionPoint

Hi,

how do I use my own extension point in the plugin?

I have defined my extension point SuperPluginConfiguratorFactory with an interface and would like to be instantiated by CommunityEditionConfiguratorFactory. In case I detect ultimate edition I'd like to have UltimateEditionConfiguratorFactory implementation instantiated.

  • plugin.xml
<idea-plugin version="2">

    <id>com.intellij.idea.plugin.mysuperplugin</id>

    <extensionPoints>
        <extensionPoint name="SuperPluginConfiguratorFactory" interface="com.intellij.idea.plugin.project.configurators.ConfiguratorFactory"></extensionPoint>
    </extensionPoints>

    <extensions defaultExtensionNs="com.intellij.idea.plugin.mysuperplugin">
        <SuperPluginConfiguratorFactory implementation="com.intellij.idea.plugin.project.configurators.CommunityEditionConfiguratorFactory"></SuperPluginConfiguratorFactory >
    </extensions>
    <depends optional="true" config-file="spring-optional-dependencies.xml">com.intellij.spring</depends>
...



spring-optional-dependencies.xml

    <extensions defaultExtensionNs="com.intellij.idea.plugin.mysuperplugin">
        <SuperPluginConfiguratorFactory implementation="com.intellij.idea.plugin.project.configurators.UltimateEditionConfiguratorFactory"></SuperPluginConfiguratorFactory >
    </extensions>

in java what do I do when I want to get ConfiguratorFactory instance?

Extensions.getExtensions("SuperPluginConfiguratorFactory");
 
returns exception 
java.lang.IllegalArgumentException: Missing extension point: SuperPluginConfiguratorFactory in area null

Please sign in to leave a comment.