basic_action_system.md, working_with_custom_actions.md: ID requirement adjustments

This commit is contained in:
Karol Lewandowski 2025-02-12 12:48:24 +01:00
parent 18ac156146
commit 7f74fe3be4
2 changed files with 6 additions and 8 deletions

View File

@ -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 # Actions
@ -146,12 +146,10 @@ An example of inspecting PSI elements is demonstrated in the `action_basics` SDK
### Action IDs ### Action IDs
Every action and action group has a unique identifier. 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)).
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 requires a unique identifier for every context where it appears in the IDE UI, even if the implementation FQN is shared.
An action must have a unique identifier for each place. Standard IntelliJ Platform action IDs are defined in [`IdeActions`](%gh-ic%/platform/ide-core/src/com/intellij/openapi/actionSystem/IdeActions.java).
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).
### Grouping Actions ### Grouping Actions

View File

@ -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: 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. 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. 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. * <control>Class Name</control> - The FQN implementation class for the action.