mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
basic_action_system.md, working_with_custom_actions.md: ID requirement adjustments
This commit is contained in:
parent
18ac156146
commit
7f74fe3be4
@ -1,4 +1,4 @@
|
||||
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
<!-- Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
|
||||
|
||||
# Actions
|
||||
|
||||
@ -146,12 +146,10 @@ An example of inspecting PSI elements is demonstrated in the `action_basics` SDK
|
||||
|
||||
### Action IDs
|
||||
|
||||
Every action and action group has a unique identifier.
|
||||
Basing the identifier for a custom action on the fully qualified name of the implementation is the best practice, assuming the package incorporates the [`<id>`](plugin_configuration_file.md#idea-plugin__id) of the plugin.
|
||||
Including the plugin identifier in the action identifier should prevent it from clashing with other plugins' actions.
|
||||
An action must have a unique identifier for each place.
|
||||
It is used in the IDE UI, even though the FQN of the implementation is the same.
|
||||
Definitions of identifiers for the standard IntelliJ Platform actions are in [`IdeActions`](%gh-ic%/platform/ide-core/src/com/intellij/openapi/actionSystem/IdeActions.java).
|
||||
Each action and action group must have a unique identifier (see the `id` attribute specification for [`action`](plugin_configuration_file.md#idea-plugin__actions__action) and [`group`](plugin_configuration_file.md#idea-plugin__actions__group)).
|
||||
|
||||
An action requires a unique identifier for every context where it appears in the IDE UI, even if the implementation FQN is shared.
|
||||
Standard IntelliJ Platform action IDs are defined in [`IdeActions`](%gh-ic%/platform/ide-core/src/com/intellij/openapi/actionSystem/IdeActions.java).
|
||||
|
||||
### Grouping Actions
|
||||
|
||||
|
@ -67,7 +67,7 @@ Fill out the <control>New Action</control> form to set up the parameters for `Po
|
||||
|
||||
The fields of the form are:
|
||||
|
||||
* <control>Action ID</control> - Every action must have a unique ID.
|
||||
* <control>Action ID</control> - Every action must have a unique [ID](plugin_configuration_file.md#idea-plugin__actions__action).
|
||||
If the action class is used in only one place in the IDE UI, then the class fully qualified name (FQN) is a good default for the ID.
|
||||
Using the action class in multiple places requires mangling the ID, such as adding a suffix to the FQN, for each ID.
|
||||
* <control>Class Name</control> - The FQN implementation class for the action.
|
||||
|
Loading…
x
Reference in New Issue
Block a user