mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
plugin_extensions.md: structure EP properties
This commit is contained in:
parent
2e70043b97
commit
d9c802bbc4
@ -20,6 +20,12 @@
|
||||
Deprecated, see notes.
|
||||
</primary-label>
|
||||
|
||||
<primary-label id="2019.2" short-name="2019.2+" name="2019.2+">
|
||||
Available in IDE version 2019.2 or later
|
||||
</primary-label>
|
||||
<primary-label id="2019.3" short-name="2019.3+" name="2019.3">
|
||||
Available in IDE version 2019.3 or later
|
||||
</primary-label>
|
||||
<primary-label id="2020.1" short-name="2020.1+" name="2020.1+">
|
||||
Available in IDE version 2020.1 or later
|
||||
</primary-label>
|
||||
|
@ -55,20 +55,20 @@ and one extension to access the `another.plugin.myExtensionPoint` extension poin
|
||||
-->
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<appStarter
|
||||
implementation="com.example.MyAppStarter"/>
|
||||
implementation="com.example.MyAppStarter"/>
|
||||
<projectTemplatesFactory
|
||||
implementation="com.example.MyProjectTemplatesFactory"/>
|
||||
implementation="com.example.MyProjectTemplatesFactory"/>
|
||||
</extensions>
|
||||
|
||||
<!--
|
||||
Declare extensions to access extension points in a custom plugin "another.plugin".
|
||||
The "myExtensionPoint" extension point has been declared using "beanClass"
|
||||
and exposes custom properties "key" and "implementationClass".
|
||||
-->
|
||||
<!--
|
||||
Declare extensions to access extension points in a custom plugin "another.plugin".
|
||||
The "myExtensionPoint" extension point has been declared using "beanClass"
|
||||
and exposes custom properties "key" and "implementationClass".
|
||||
-->
|
||||
<extensions defaultExtensionNs="another.plugin">
|
||||
<myExtensionPoint
|
||||
key="keyValue"
|
||||
implementationClass="com.example.MyExtensionPointImpl"/>
|
||||
<myExtensionPoint
|
||||
key="keyValue"
|
||||
implementationClass="com.example.MyExtensionPointImpl"/>
|
||||
</extensions>
|
||||
```
|
||||
|
||||
@ -106,33 +106,48 @@ If an extension instance needs to "opt out" in certain scenarios, it can throw [
|
||||
|
||||
Several tooling features are available to help configure bean class extension points in <path>plugin.xml</path>.
|
||||
|
||||
Properties annotated with [`RequiredElement`](%gh-ic%/platform/core-api/src/com/intellij/openapi/extensions/RequiredElement.java) are inserted automatically and validated (2019.3 and later).
|
||||
If the given property is allowed to have an explicit empty value, set `allowEmpty` to `true` (2020.3 and later).
|
||||
#### Required Properties
|
||||
<primary-label ref="2019.3"/>
|
||||
|
||||
Property names matching the following list will resolve to fully qualified class name:
|
||||
Properties annotated with [`RequiredElement`](%gh-ic%/platform/core-api/src/com/intellij/openapi/extensions/RequiredElement.java) are inserted automatically and validated.
|
||||
|
||||
If the given property is allowed to have an explicit empty value, set `allowEmpty` to `true` (2020.3+).
|
||||
|
||||
#### Class names
|
||||
|
||||
Property names matching the following list will resolve to a fully qualified class name:
|
||||
|
||||
- `implementation`
|
||||
- `className`
|
||||
- `serviceInterface` / `serviceImplementation`
|
||||
- ending with `Class` (case-sensitive)
|
||||
- `serviceInterface`/`serviceImplementation`
|
||||
|
||||
A required parent type can be specified in the extension point declaration via nested [`<with>`](plugin_configuration_file.md#idea-plugin__extensionPoints__extensionPoint__with):
|
||||
A required parent type can be specified in the [extension point declaration](plugin_extension_points.md) via [`<with>`](plugin_configuration_file.md#idea-plugin__extensionPoints__extensionPoint__with):
|
||||
|
||||
```xml
|
||||
|
||||
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
|
||||
<with
|
||||
attribute="psiElementClass"
|
||||
implements="com.intellij.psi.PsiElement"/>
|
||||
<with attribute="psiElementClass"
|
||||
implements="com.intellij.psi.PsiElement"/>
|
||||
</extensionPoint>
|
||||
```
|
||||
|
||||
Property name `language` (or ending in `*Language`, 2020.2+) resolves to all present `Language` IDs.
|
||||
#### Custom resolve
|
||||
|
||||
Similarly, `action`/`actionId` (2024.3+) resolves to all registered [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) IDs.
|
||||
Property name `language` (or ending in `*Language`, 2020.2+) resolves to all present [`Language`](%gh-ic%/platform/core-api/src/com/intellij/lang/Language.java) IDs.
|
||||
|
||||
Annotating with [`@Nls`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/Nls.java) validates a UI `String` capitalization according to the text property `Capitalization` enum value (2019.2 and later).
|
||||
Similarly, `action` and `actionId` (2024.3+) resolve to all registered [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) IDs.
|
||||
|
||||
#### Deprecation/ApiStatus
|
||||
|
||||
Properties marked as `@Deprecated` or annotated with any of [`ApiStatus`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/ApiStatus.java) `@Internal`, `@Experimental`, `@ScheduledForRemoval`, or `@Obsolete` will be highlighted accordingly.
|
||||
|
||||
Attributes with `Enum` type support code insight with _lowerCamelCased_ notation (2020.1 and later). Note: these must not override `toString()`.
|
||||
#### Enum properties
|
||||
<primary-label ref="2020.1"/>
|
||||
|
||||
Attributes with `Enum` type support code insight with _lowerCamelCased_ notation. Note: Enum implementation must not override `toString()`.
|
||||
|
||||
#### I18n
|
||||
<primary-label ref="2019.2"/>
|
||||
|
||||
Annotating with [`@Nls`](%gh-java-annotations%/common/src/main/java/org/jetbrains/annotations/Nls.java) validates a UI `String` capitalization according to the text property `Capitalization` enum value.
|
||||
|
Loading…
x
Reference in New Issue
Block a user