How to add a JComponent to pre-existing Run configuration editor

Answered

I am not entirely sure this is possible, but I am trying to add a custom component (JButton, JLabel, etc...) to an existing Run Configuration Editor, so far this is what I have tried.

RunManager instance = RunManager.getInstance(project);
RunnerAndConfigurationSettings nodejsTemplate = instance.createConfiguration("my-config-name", NodeJsRunConfigurationType.getInstance());
(NodeJsRunConfiguration) nodejsTemplate.getConfiguration();
nodejsTemplate.getConfiguration().getConfigurationEditor().getComponent();

However this produce an error:

java.lang.UnsupportedOperationException: This method should never be called!

So I guess that is the wrong direction.

I was thinking to create my own class and extends to the

NodeRunConfigurationEditor

However the class is private and I will have to make a lot of plumbing work.

Is there an easy way to achieve this? Thanks

1 comment
Comment actions Permalink

Please see com.jetbrains.nodejs.run.NodeJSRunConfigurationExtension, EP: NodeJS.runConfigurationExtension.

It extends generic com.intellij.execution.configuration.RunConfigurationExtensionBase (samples: https://plugins.jetbrains.com/intellij-platform-explorer?extensions=com.intellij.runConfigurationExtension), see its javadoc

0

Please sign in to leave a comment.