Invoking a dialog from another plugin


I wrote two plugins each with their own functionality. Now i would like to invoke a dialog from plugin A in plugin B.

I've added <depends>plugin A</depends> to plugin B plugins.xml

The dialog class is available in plugin B. When I start the dialog, it tries to retrieve the ProjectState for plugin A. This is necessary for the dialog to work properly.

I get the following Exception (TPCM is plugin A).

java.lang.ClassCastException: nl.frankdekker.TPCM.Config.TargetProcessProjectState cannot be cast to nl.frankdekker.TPCM.Config.TargetProcessProjectState
at nl.frankdekker.TPCM.Config.TargetProcessProjectState.getInstance(
at nl.frankdekker.TPCM.TaskDialog.restoreState(
at nl.frankdekker.TPCM.TaskDialog.createCenterPanel(
at com.intellij.openapi.ui.DialogWrapper.init(

It seems im unable to retrieve the ProjectState for plugin A. How can this be solved?


Much appreciated


Hi Frank,

such errors may happen if there are two TargetProcessProjectState classes loaded by different classloaders. Probably you packaged TargetProcessProjectState.class into the both plugins, you should package it into plugin A jars only.


Doh, I had indeed included the plugin in the other plugin project. For code completion purposes. Didn't realize it was actually included in the final jar.



Please sign in to leave a comment.