mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-27 16:57:49 +08:00
Rename working_with_custom_actions.md to creating_actions_tutorial.md
This commit is contained in:
parent
11250f17d2
commit
983decd409
2
ijs.tree
2
ijs.tree
@ -102,7 +102,7 @@
|
||||
</toc-element>
|
||||
<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="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>
|
||||
</toc-element>
|
||||
|
@ -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.
|
||||
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.
|
||||
|
||||
## Action Implementation
|
||||
|
@ -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.
|
||||
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
|
||||
|
||||
@ -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 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.
|
||||
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
|
||||
<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 `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.
|
||||
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.
|
||||
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`.
|
||||
|
||||
{width="550"}
|
||||
@ -93,7 +93,7 @@ The underlying `PopupDialogAction` implementation is reused for two entries in t
|
||||
## Implementing Custom Action Group Classes
|
||||
|
||||
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.
|
||||
In this case, the condition is having an instance of available editor.
|
||||
|
@ -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.
|
||||
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)
|
||||
|
||||
The source code for the [`action_basics`](%gh-sdk-samples-master%/action_basics) code sample is used throughout this tutorial.
|
||||
|
@ -183,7 +183,7 @@ Gradle projects are run from the IDE's Gradle Tool window.
|
||||
### 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.
|
||||
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
|
||||
|
||||
|
@ -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).
|
||||
|
||||
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:
|
||||
|
||||
```xml
|
||||
|
Loading…
x
Reference in New Issue
Block a user