This topic explains how you can create a plugin that contributes customize the system dialog box Settings displayed when you click Image Added on the IDEA toolbar.
To customize this dialog, your plugin must contribute to the applicationConfigurable extenstion point. or projectConfigurable extenstion points available in the IDEA core.
The applicationConfigurable extension point is designed to configure IDEA settings pertaining to your workspace (IDE settings). The IntelliJ IDEA UI provides the Settings dialog you can display by clicking on the IDEA toolbar. The settings pertaining to your workspace are displayed under IDE Settings (see the screenshot below).
For more information about extensions and extension points, see IntelliJ IDEA Plugin Structure .
Creation of Extension to applicationConfigurable
To create a plugin that contributes to the applicationConfigurable extension point, perform the following principal steps:
- In your plugin project, create a Java class that implements the Configurable interface.
- In this class, override the following methods:
createComponent: creates the UI visual form and returns its root element.
apply: this method is called when the user clicks the OK or Apply button.
reset: this method is called when the user clicks the Cancel button.
isModified: this method is regularly called to check the form for changes. If the method returns
false, the Apply button is disabled.
disposeUIResources: this method is called when the user closes the form. In this method, you can, for example, release the resources used by the form.
- In the plugin configuration file plugin.xml, create the <extensions defaultExtensionNs="com.intellij"> </extensions> section.
- To this section, add the <applicationConfigurable implementation=%MyJavaClassName%></applicationConfigurable> section, where the %MyJavaClassName% refers to the name of your Java class implementing the
Sample Plugin: Extension to the applicationConfigurable Extension Point
To clarify the above procedure, consider the applicationConfigurable sample plugin adds the new menu command "Menu Font" to the IDE Settings area. Clicking this commands causes IntelliJ IDEA to display a visual form designed to specify a font used for the IntelliJ IDEA menus. This UI is similar to the following screen: