Child pages
  • Implementing Run Configurations in IntelliJ IDEA
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

A run configuration provides the user with the possibility to run a certain type of external process (script, application server etc.) from within the IDE. You can provide UI for the user to specify execution options, as well as the possibility to create run configuration based on a specific location in the source code.

ConfigurationType

The starting point for implementing any run configuration type is the ConfigurationType interface. Your implementation of that interface needs to be registered in the <configurationType> extension point in plugin.xml.

The easiest way to implement this interface is to use the ConfigurationTypeBase base class. In order to use it, you need to inherit from it and to provide the configuration type parameters (ID, name, description and icon) as constructor parameters. In addition to that, you need to call the addFactory() method to add a configuration factory.

ConfigurationFactory

Each run configuration type needs to provide at least one ConfigurationFactory. One is normally enough, but you can provide more than one if your run configuration can be created in multiple variants (for example, local and remote for an application server).

The key API of ConfigurationFactory, and the only method that you're required to implement, is the createTemplateConfiguration method. This method is called once per project to create the template run configuration. All real run configurations (loaded from the workspace or created by the user) are called by cloning the template through the createConfiguration method.

You can customize additional aspects of your configuration factory by overriding the getIcon, getAddIcon, getName and the default settings methods. These additional overrides are optional.

Icon

to be continued

  • No labels