basic_action_system.md: minor

This commit is contained in:
Yann Cébron 2024-04-09 20:03:43 +02:00
parent c19af1b197
commit f0c4df5d83

View File

@ -56,9 +56,8 @@ Every IntelliJ Platform action should override `AnAction.update()` and must over
When switching from BGT to EDT is absolutely necessary, actions can use `AnActionEvent.getUpdateSession()` to When switching from BGT to EDT is absolutely necessary, actions can use `AnActionEvent.getUpdateSession()` to
access the [`UpdateSession`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/UpdateSession.java) and access the [`UpdateSession`](%gh-ic%/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/UpdateSession.java) and
then call `UpdateSession.compute()` to run a function on the EDT. then call `UpdateSession.compute()` to run a function on the EDT.
Starting from IntelliJ Platform version 2022.3, the Plugin DevKit will have an inspection in Inspection <ui-path>Plugin DevKit | Code | ActionUpdateThread is missing</ui-path> highlights missing implementation of
<ui-path>Plugin DevKit | Code | ActionUpdateThread is missing</ui-path> to notify plugin authors about a missing implementation of `AnAction.getActionUpdateThread()` (2022.3+).
`AnAction.getActionUpdateThread()`.
* An action's method `AnAction.actionPerformed()` is called by the IntelliJ Platform if available and selected by the user. * An action's method `AnAction.actionPerformed()` is called by the IntelliJ Platform if available and selected by the user.
This method does the heavy lifting for the action: it contains the code executed when the action gets invoked. This method does the heavy lifting for the action: it contains the code executed when the action gets invoked.
The `actionPerformed()` method also receives `AnActionEvent` as a parameter, which is used to access any context data like projects, files, selection, etc. The `actionPerformed()` method also receives `AnActionEvent` as a parameter, which is used to access any context data like projects, files, selection, etc.