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.
|
Deprecated, see notes.
|
||||||
</primary-label>
|
</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+">
|
<primary-label id="2020.1" short-name="2020.1+" name="2020.1+">
|
||||||
Available in IDE version 2020.1 or later
|
Available in IDE version 2020.1 or later
|
||||||
</primary-label>
|
</primary-label>
|
||||||
|
@ -55,20 +55,20 @@ and one extension to access the `another.plugin.myExtensionPoint` extension poin
|
|||||||
-->
|
-->
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<appStarter
|
<appStarter
|
||||||
implementation="com.example.MyAppStarter"/>
|
implementation="com.example.MyAppStarter"/>
|
||||||
<projectTemplatesFactory
|
<projectTemplatesFactory
|
||||||
implementation="com.example.MyProjectTemplatesFactory"/>
|
implementation="com.example.MyProjectTemplatesFactory"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
Declare extensions to access extension points in a custom plugin "another.plugin".
|
Declare extensions to access extension points in a custom plugin "another.plugin".
|
||||||
The "myExtensionPoint" extension point has been declared using "beanClass"
|
The "myExtensionPoint" extension point has been declared using "beanClass"
|
||||||
and exposes custom properties "key" and "implementationClass".
|
and exposes custom properties "key" and "implementationClass".
|
||||||
-->
|
-->
|
||||||
<extensions defaultExtensionNs="another.plugin">
|
<extensions defaultExtensionNs="another.plugin">
|
||||||
<myExtensionPoint
|
<myExtensionPoint
|
||||||
key="keyValue"
|
key="keyValue"
|
||||||
implementationClass="com.example.MyExtensionPointImpl"/>
|
implementationClass="com.example.MyExtensionPointImpl"/>
|
||||||
</extensions>
|
</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>.
|
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).
|
#### Required Properties
|
||||||
If the given property is allowed to have an explicit empty value, set `allowEmpty` to `true` (2020.3 and later).
|
<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`
|
- `implementation`
|
||||||
- `className`
|
- `className`
|
||||||
- `serviceInterface` / `serviceImplementation`
|
|
||||||
- ending with `Class` (case-sensitive)
|
- 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
|
```xml
|
||||||
|
|
||||||
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
|
<extensionPoint name="myExtension" beanClass="MyExtensionBean">
|
||||||
<with
|
<with attribute="psiElementClass"
|
||||||
attribute="psiElementClass"
|
implements="com.intellij.psi.PsiElement"/>
|
||||||
implements="com.intellij.psi.PsiElement"/>
|
|
||||||
</extensionPoint>
|
</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.
|
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