IDEA 2016.1 change in settings

My plugin's settings is not displayed after upgrading to 2016.1. It was working till 15.0.x. In plugin.xml I had just given:

<project-components>
        <component>
            <implementation-class>com.intellij.plugins.bodhi.pmd.PMDProjectComponent</implementation-class>
            <interface-class>com.intellij.plugins.bodhi.pmd.PMDProjectComponent</interface-class>
        </component>
</project-components>

The ProjectComponent itself implemented Configurable also.


I tried adding the following snippet:

<extensions defaultExtensionNs="com.intellij">
        <applicationConfigurable id="PMD" displayName="PMD" instance="com.intellij.plugins.bodhi.pmd.PMDProjectComponent"/>
</extensions>

After this the menu is displayed in settings, but on clicking it getting the following exception:

[  18012]  ERROR - openapi.options.ConfigurableEP - com.intellij.plugins.bodhi.pmd.PMDProjectComponent has unsatisfied dependency: interface com.intellij.openapi.project.Project among unsatisfiable dependencies: [[interface com.intellij.openapi.project.Project]] where DefaultPicoContainer (root) was the leaf container being asked for dependencies.
org.picocontainer.defaults.UnsatisfiableDependenciesException: com.intellij.plugins.bodhi.pmd.PMDProjectComponent has unsatisfied dependency: interface com.intellij.openapi.project.Project among unsatisfiable dependencies: [[interface com.intellij.openapi.project.Project]] where DefaultPicoContainer (root) was the leaf container being asked for dependencies.
    at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getGreediestSatisfiableConstructor(ConstructorInjectionComponentAdapter.java:114)
    at org.picocontainer.defaults.ConstructorInjectionComponentAdapter$1.run(ConstructorInjectionComponentAdapter.java:210)
    at org.picocontainer.defaults.ThreadLocalCyclicDependencyGuard.observe(ThreadLocalCyclicDependencyGuard.java:53)
    at org.picocontainer.defaults.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:248)
    at com.intellij.util.pico.ConstructorInjectionComponentAdapter.getComponentInstance(ConstructorInjectionComponentAdapter.java:59)
    at com.intellij.openapi.extensions.AbstractExtensionPointBean.instantiate(AbstractExtensionPointBean.java:75)
    at com.intellij.openapi.options.ConfigurableEP$ClassProducer.createElement(ConfigurableEP.java:347)
    at com.intellij.openapi.options.ConfigurableEP.createConfigurable(ConfigurableEP.java:273)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.createConfigurable(ConfigurableWrapper.java:54)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.getConfigurable(ConfigurableWrapper.java:121)
    at com.intellij.openapi.options.ex.ConfigurableWrapper.cast(ConfigurableWrapper.java:102)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.prepare(ConfigurableCardPanel.java:42)
    at com.intellij.openapi.options.ex.ConfigurableCardPanel.prepare(ConfigurableCardPanel.java:35)
    at com.intellij.ui.CardLayoutPanel$1.run(CardLayoutPanel.java:129)
    at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:369)

Any idea what should I do?

3 comments

Probably, you should use `projectConfigurable` instead of `applicationConfigurable`, because PMDProjectComponent has "Project" as one of its constructor's parameters.

0

Thanks Aleksey, it works. However, after using the projectConfigurable it seem to create new instances of it every time the setting is loaded. Is it possible to reuse the ProjectComponent instance (I'm using same class as ProjectComponent and Configurable)?

0

You can register ConfigurableProvider, that would return your ProjectComponent.

<projectConfigurable groupId="SomeId" id="MyId" displayName="MyPlugin" provider="com.some.plugin.MyConfigurableProvider">

0

Please sign in to leave a comment.