mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
basic_action_system.md: Add information about executing actions programmatically
This commit is contained in:
parent
c182a4da93
commit
8b7c2d7d13
@ -427,3 +427,13 @@ Use [`BackAction`](%gh-ic%/platform/platform-api/src/com/intellij/ui/navigation/
|
|||||||
For actions registered at runtime (e.g., in a tool window toolbar), add an [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) entry with
|
For actions registered at runtime (e.g., in a tool window toolbar), add an [`<action>`](plugin_configuration_file.md#idea-plugin__actions__action) entry with
|
||||||
[`EmptyAction`](%gh-ic%/platform/platform-api/src/com/intellij/openapi/actionSystem/EmptyAction.java)
|
[`EmptyAction`](%gh-ic%/platform/platform-api/src/com/intellij/openapi/actionSystem/EmptyAction.java)
|
||||||
to "reserve" Action ID, so they become visible in <ui-path>Settings | Keymap</ui-path>.
|
to "reserve" Action ID, so they become visible in <ui-path>Settings | Keymap</ui-path>.
|
||||||
|
|
||||||
|
## Executing Actions Programmatically
|
||||||
|
|
||||||
|
Sometimes, it is required to execute actions programmatically, e.g., executing an action implementing logic we need and the implementation is out of our control.
|
||||||
|
Executing actions can be achieved with [`ActionUtils.invokeAction()`](%gh-ic%/platform/platform-api/src/com/intellij/openapi/actionSystem/ex/ActionUtil.java).
|
||||||
|
|
||||||
|
> Executing actions programmatically should be avoided whenever possible.
|
||||||
|
> If an action executed programmatically is under your control, extract its logic to a service or util and call it directly.
|
||||||
|
>
|
||||||
|
{style="warning"}
|
||||||
|
@ -12,6 +12,13 @@ See [GitHub Changelog](https://github.com/JetBrains/intellij-sdk-docs/commits/ma
|
|||||||
|
|
||||||
## 2023
|
## 2023
|
||||||
|
|
||||||
|
### November
|
||||||
|
{#november-23}
|
||||||
|
|
||||||
|
Minor Changes and Additions
|
||||||
|
:
|
||||||
|
- Add information about [executing actions programmatically](basic_action_system.md#executing-actions-programmatically).
|
||||||
|
|
||||||
### October
|
### October
|
||||||
{#october-23}
|
{#october-23}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user