How to mark a run configuration as invalid?

For the plugin I am developing, the user can create run configurations and must select a module and a class. If he does not select that, I want the run configuration to be added but be marked as invalid ( that red X), so the user knows he was forgotten something. How can I achieve that?

0
1 comment

In your implementation of RunConfiguration override   checkConfiguration()

Throw an instance of RuntimeConfigurationException to indicate an error.

@Override
public void checkConfiguration() throws RuntimeConfigurationException {
    super.checkConfiguration();

    if (/* invalid configuration settings */)
         throw new RuntimeConfigurationException("Reason the configuration is invliad.");
}

0

Please sign in to leave a comment.