Rename working_with_custom_actions.md to creating_actions_tutorial.md

This commit is contained in:
Karol Lewandowski 2025-03-10 15:25:49 +01:00
parent 11250f17d2
commit 983decd409
7 changed files with 10 additions and 10 deletions

View File

@ -102,7 +102,7 @@
</toc-element> </toc-element>
<toc-element topic="action_system.md" accepts-web-file-names="action_system.html,basic-action-system.html"> <toc-element topic="action_system.md" accepts-web-file-names="action_system.html,basic-action-system.html">
<toc-element topic="actions_tutorial.md"> <toc-element topic="actions_tutorial.md">
<toc-element topic="working_with_custom_actions.md"/> <toc-element topic="creating_actions_tutorial.md" accepts-web-file-names="working-with-custom-actions.html"/>
<toc-element topic="grouping_action.md"/> <toc-element topic="grouping_action.md"/>
</toc-element> </toc-element>
</toc-element> </toc-element>

View File

@ -24,7 +24,7 @@ The action implementation determines the contexts in which an action is availabl
Registration determines where an action appears in the IDE UI. Registration determines where an action appears in the IDE UI.
Once implemented and registered, an action receives callbacks from the IntelliJ Platform in response to user gestures. Once implemented and registered, an action receives callbacks from the IntelliJ Platform in response to user gestures.
The [](working_with_custom_actions.md) tutorial describes the process of adding a custom action to a plugin. The [](creating_actions_tutorial.md) tutorial describes the process of adding a custom action to a plugin.
The [](grouping_action.md) tutorial demonstrates three types of groups that can contain actions. The [](grouping_action.md) tutorial demonstrates three types of groups that can contain actions.
## Action Implementation ## Action Implementation

View File

@ -8,7 +8,7 @@ If an implementation requires several actions, or there are simply too many acti
This tutorial demonstrates adding an action to an existing group, creating a new action group, and action groups with a variable number of actions. This tutorial demonstrates adding an action to an existing group, creating a new action group, and action groups with a variable number of actions.
The sample code discussed in this tutorial is from the code sample [`action_basics`](%gh-sdk-samples-master%/action_basics). The sample code discussed in this tutorial is from the code sample [`action_basics`](%gh-sdk-samples-master%/action_basics).
Some content in this tutorial assumes the reader is familiar with the [](working_with_custom_actions.md) tutorial. Some content in this tutorial assumes the reader is familiar with the [](creating_actions_tutorial.md) tutorial.
## Simple Action Groups ## Simple Action Groups
@ -40,7 +40,7 @@ See [](action_system.md#registering-actions-in-pluginxml) for more information a
The following sample shows how to use an [`<add-to-group>`](plugin_configuration_file.md#idea-plugin__actions__action__add-to-group) element to place a custom action group relative to an entry in the <ui-path>Tools</ui-path> menu. The following sample shows how to use an [`<add-to-group>`](plugin_configuration_file.md#idea-plugin__actions__action__add-to-group) element to place a custom action group relative to an entry in the <ui-path>Tools</ui-path> menu.
The attribute `relative-to-action` references the action `id` for `PopupDialogAction`, not a native IntelliJ menu entry. The attribute `relative-to-action` references the action `id` for `PopupDialogAction`, not a native IntelliJ menu entry.
Rather `PopupDialogAction` is defined in the same [`plugin.xml`](%gh-sdk-samples-master%/action_basics/src/main/resources/META-INF/plugin.xml) file. Rather `PopupDialogAction` is defined in the same [`plugin.xml`](%gh-sdk-samples-master%/action_basics/src/main/resources/META-INF/plugin.xml) file.
This group is placed after the single entry for the action `PopupDialogAction`, as defined in the [Creating Actions](working_with_custom_actions.md#registering-an-action-with-the-new-action-form) tutorial. This group is placed after the single entry for the action `PopupDialogAction`, as defined in the [Creating Actions](creating_actions_tutorial.md#registering-an-action-with-the-new-action-form) tutorial.
```xml ```xml
<group <group
@ -59,7 +59,7 @@ This group is placed after the single entry for the action `PopupDialogAction`,
The `PopupDialogAction` implementation will be reused and registered in the newly created static group. The `PopupDialogAction` implementation will be reused and registered in the newly created static group.
The `id` attribute for the reused `PopupDialogAction` implementation is set to a unique value, `org.intellij.sdk.action.GroupPopDialogAction`. The `id` attribute for the reused `PopupDialogAction` implementation is set to a unique value, `org.intellij.sdk.action.GroupPopDialogAction`.
This value differentiates this new [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) entry from the `id` previously used to register this action implementation in the [Creating Actions](working_with_custom_actions.md#registering-an-action-with-the-new-action-form) tutorial. This value differentiates this new [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) entry from the `id` previously used to register this action implementation in the [Creating Actions](creating_actions_tutorial.md#registering-an-action-with-the-new-action-form) tutorial.
A unique `id` supports reuse of action classes in more than one menu or group. A unique `id` supports reuse of action classes in more than one menu or group.
The action in this group will be displayed in the menu as "A Group Action". The action in this group will be displayed in the menu as "A Group Action".
@ -85,7 +85,7 @@ The action in this group will be displayed in the menu as "A Group Action".
After performing the steps described above, the action group and its content will be available in the <ui-path>Tools</ui-path> menu. After performing the steps described above, the action group and its content will be available in the <ui-path>Tools</ui-path> menu.
The underlying `PopupDialogAction` implementation is reused for two entries in the <ui-path>Tools</ui-path> menu: The underlying `PopupDialogAction` implementation is reused for two entries in the <ui-path>Tools</ui-path> menu:
* Once for the top menu entry <ui-path>Tools | Pop Dialog Action</ui-path> with the action `id` equal to `org.intellij.sdk.action.PopupDialogAction` as set in the [Creating Actions](working_with_custom_actions.md#registering-an-action-with-the-new-action-form) tutorial. * Once for the top menu entry <ui-path>Tools | Pop Dialog Action</ui-path> with the action `id` equal to `org.intellij.sdk.action.PopupDialogAction` as set in the [Creating Actions](creating_actions_tutorial.md#registering-an-action-with-the-new-action-form) tutorial.
* A second time for the menu entry <ui-path>Tools | Static Grouped Actions | A Group Action</ui-path> with the action `id` equal to `org.intellij.sdk.action.GroupPopDialogAction`. * A second time for the menu entry <ui-path>Tools | Static Grouped Actions | A Group Action</ui-path> with the action `id` equal to `org.intellij.sdk.action.GroupPopDialogAction`.
![Simple Action Group](grouped_action.png){width="550"} ![Simple Action Group](grouped_action.png){width="550"}
@ -93,7 +93,7 @@ The underlying `PopupDialogAction` implementation is reused for two entries in t
## Implementing Custom Action Group Classes ## Implementing Custom Action Group Classes
In some cases, the specific behavior of an action group needs to depend on the context. In some cases, the specific behavior of an action group needs to depend on the context.
The solution is analogous to making a [single action entry dependent on context](working_with_custom_actions.md#extending-the-update-method). The solution is analogous to making a [single action entry dependent on context](creating_actions_tutorial.md#extending-the-update-method).
The steps below show how to make a group of actions available and visible if certain conditions are met. The steps below show how to make a group of actions available and visible if certain conditions are met.
In this case, the condition is having an instance of available editor. In this case, the condition is having an instance of available editor.

View File

@ -6,7 +6,7 @@
This tutorial leads you through a series of steps which show how to create, register, and customize custom actions and action groups. This tutorial leads you through a series of steps which show how to create, register, and customize custom actions and action groups.
By registering actions, you can add your own menu items, toolbar buttons and keyboard shortcuts to the IDE user interface. By registering actions, you can add your own menu items, toolbar buttons and keyboard shortcuts to the IDE user interface.
* [](working_with_custom_actions.md) * [](creating_actions_tutorial.md)
* [](grouping_action.md) * [](grouping_action.md)
The source code for the [`action_basics`](%gh-sdk-samples-master%/action_basics) code sample is used throughout this tutorial. The source code for the [`action_basics`](%gh-sdk-samples-master%/action_basics) code sample is used throughout this tutorial.

View File

@ -183,7 +183,7 @@ Gradle projects are run from the IDE's Gradle Tool window.
### Adding Code to the Project ### Adding Code to the Project
Before running [`my_plugin`](#components-of-a-wizard-generated-gradle-intellij-platform-plugin), some code can be added to provide simple functionality. Before running [`my_plugin`](#components-of-a-wizard-generated-gradle-intellij-platform-plugin), some code can be added to provide simple functionality.
See the [](working_with_custom_actions.md) tutorial for step-by-step instructions for adding a menu action. See the [](creating_actions_tutorial.md) tutorial for step-by-step instructions for adding a menu action.
### Executing the Plugin ### Executing the Plugin

View File

@ -21,7 +21,7 @@ In this example, we access the `Editor` from an action.
The source code for the Java class in this example is [EditorIllustrationAction](%gh-sdk-samples-master%/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java). The source code for the Java class in this example is [EditorIllustrationAction](%gh-sdk-samples-master%/editor_basics/src/main/java/org/intellij/sdk/editor/EditorIllustrationAction.java).
To register the action, we must add the corresponding elements to the [`<actions>`](plugin_configuration_file.md#idea-plugin__actions) section of the plugin configuration file [plugin.xml](%gh-sdk-samples-master%/editor_basics/src/main/resources/META-INF/plugin.xml). To register the action, we must add the corresponding elements to the [`<actions>`](plugin_configuration_file.md#idea-plugin__actions) section of the plugin configuration file [plugin.xml](%gh-sdk-samples-master%/editor_basics/src/main/resources/META-INF/plugin.xml).
For more information, refer to the [](working_with_custom_actions.md#registering-a-custom-action) section. For more information, refer to the [](creating_actions_tutorial.md#registering-a-custom-action) section.
The `EditorIllustrationAction` action is registered in the group `EditorPopupMenu` so it will be available from the context menu when focus is on the editor: The `EditorIllustrationAction` action is registered in the group `EditorPopupMenu` so it will be available from the context menu when focus is on the editor:
```xml ```xml