How can I override a service implementation?

Hi,

I'd like to provide my own implementation to a core intellij service in the proper way.

I tried this, in my plugin.xml:

<extensions defaultExtensionNs="com.intellij">
    <applicationService serviceInterface="com.intellij.openapi.wm.impl.FrameTitleBuilder"
         serviceImplementation="com.my.package.MyFrameTitleBuilder"
         overrides="com.intellij.openapi.wm.impl.FrameTitleBuilder"
     />
</extensions>

however it fails like this:

org.picocontainer.defaults.DuplicateComponentKeyRegistrationException: Key com.intellij.openapi.wm.impl.FrameTitleBuilder duplicated

can anyone help?

Thanks,
Steve
1 comment

Ok, I found I can cast the PicoContainer to a MutablePicoContainer and unregister / reregister the component I want to
replace.

Is this a correct approach?

Thank you
viking steve

0

Please sign in to leave a comment.