From 49dfc7b9807891ce1c134a10cce45de981d9af9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yann=20C=C3=A9bron?= Date: Thu, 5 Dec 2019 11:09:13 +0100 Subject: [PATCH] plugin_extension_points.md: cleanup --- .../plugin_extension_points.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/basics/plugin_structure/plugin_extension_points.md b/basics/plugin_structure/plugin_extension_points.md index 1a363f693..921e8afd6 100644 --- a/basics/plugin_structure/plugin_extension_points.md +++ b/basics/plugin_structure/plugin_extension_points.md @@ -2,6 +2,8 @@ title: Plugin Extension Points --- +> **NOTE** See [Plugin Extensions](plugin_extensions.md) for _using_ extension points in your plugin. + By defining _extension points_ in your plugin, you can allow other plugins to extend the functionality of your plugin. There are two types of extension points: @@ -15,26 +17,24 @@ There are two types of extension points: You can declare extensions and extension points in the plugin configuration file `plugin.xml`, within the `` and `` sections, respectively. -To declare extension points in your plugin, add an `` section to your plugin.xml. Then insert a child element `` that defines the extension point name and the name of a bean class or an interface that is allowed to extend the plugin functionality in the `name`, `beanClass` and `interface` attributes, respectively. - -To clarify this procedure, consider the following sample section of the plugin.xml file: +To declare extension points in your plugin, add an `` section to your `plugin.xml`. Then insert a child element `` that defines the extension point name and the name of a bean class or an interface that is allowed to extend the plugin functionality in the `name`, `beanClass` and `interface` attributes, respectively. ```xml - - + + ``` -* The `interface` attribute sets an interface the plugin that contributes to the extension point must implement. * The `beanClass` attribute sets a bean class that specifies one or several properties annotated with the [`@Attribute`](upsource:///platform/util/src/com/intellij/util/xmlb/annotations/Attribute.java) annotation. +* The `interface` attribute sets an interface the plugin that contributes to the extension point must implement. The plugin that contributes to the extension point will read those properties from the `plugin.xml` file. -To clarify this, consider the following sample `MyBeanClass1` bean class used in the above `plugin.xml` file: +To clarify this, consider the following sample `MyBeanClass` bean class used in the above `plugin.xml` file: ```java -public class MyBeanClass1 extends AbstractExtensionPointBean { +public class MyBeanClass extends AbstractExtensionPointBean { @Attribute("key") public String key; @@ -51,5 +51,6 @@ public class MyBeanClass1 extends AbstractExtensionPointBean { } ``` -To declare an extension designed to access the `MyExtensionPoint1` extension point, your `plugin.xml` file must contain the `` tag with the `key` and `implementationClass` attributes set to appropriate values (see sample below). +To declare an extension designed to access the `myExtensionPoint1` extension point, your `plugin.xml` file must contain the `` tag with the `key` and `implementationClass` attributes set to appropriate values. +> **TIP** See [Extension properties code insight](plugin_extensions.md#extension-properties-code-insight) on how to provide smart completion/validation.