From a5bf79efb036ef07839d6bfb33fb7eedecdac538 Mon Sep 17 00:00:00 2001 From: Karol Lewandowski Date: Mon, 9 Dec 2024 14:02:53 +0100 Subject: [PATCH] working_with_custom_actions.md: Cleanup --- .../action_system/working_with_custom_actions.md | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/topics/tutorials/action_system/working_with_custom_actions.md b/topics/tutorials/action_system/working_with_custom_actions.md index fbdc19259..3f3fad6f4 100644 --- a/topics/tutorials/action_system/working_with_custom_actions.md +++ b/topics/tutorials/action_system/working_with_custom_actions.md @@ -15,7 +15,7 @@ Using the SDK code sample [`action_basics`](%gh-sdk-samples-master%/action_basic Custom actions extend the abstract class [`AnAction`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java). Classes that extend it should override `AnAction.update()`, and must override `AnAction.actionPerformed()`. * The `update()` method implements the code that enables or disables an action. -* The `actionPerformed()` method implements the code that executes when an action is invoked by the user. +* The `actionPerformed()` method implements the code that executes when the user invokes an action. * When targeting IntelliJ Platform 2022.3 or later, `AnAction.getActionUpdateThread()` must be implemented As an example, [`PopupDialogAction`](%gh-sdk-samples-master%/action_basics/src/main/java/org/intellij/sdk/action/PopupDialogAction.java) overrides `AnAction` for the `action_basics` code sample. @@ -60,7 +60,7 @@ A more comprehensive explanation of action registration is available in the [](b ### Registering an Action with the New Action Form -To register `PopupDialogAction` and set up its basic attributes press Alt+Shift+Enter. +To register `PopupDialogAction` and set up its basic attributes, press Alt+Shift+Enter. Fill out the New Action form to set up the parameters for `PopupDialogAction`: ![New Action](new_action.png){width="800"} @@ -94,10 +94,17 @@ After finishing the New Action form and applying the changes, ``` -The [``](plugin_configuration_file.md#idea-plugin__actions__action) element declares the Action ID (`id`), Class Name (`class`), Name (`text`), and Description from the New Action form. +The [``](plugin_configuration_file.md#idea-plugin__actions__action) element declares the: +- Action ID (`id`) +- Class Name (`class`) +- Name (`text`) +- Description + +from the New Action form. + The [``](plugin_configuration_file.md#idea-plugin__actions__action__add-to-group) element declares where the action will appear and mirrors the names of entries from the form. -This declaration is adequate, but adding more attributes is discussed in the next section. +This declaration is sufficient, but adding more attributes is discussed in the next section. ### Setting Registration Attributes Manually