mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
[md] EditorActionHandler illustration
This commit is contained in:
parent
ef69a7abc4
commit
a724faeeb5
@ -102,11 +102,14 @@ Class
|
|||||||
[EditorActionHandler.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorActionHandler.java)
|
[EditorActionHandler.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/platform-api/src/com/intellij/openapi/editor/actionSystem/EditorActionHandler.java)
|
||||||
also stays for actions activated by keystrokes in the editor.
|
also stays for actions activated by keystrokes in the editor.
|
||||||
This type of the editor handler should be registered as an extension point
|
This type of the editor handler should be registered as an extension point
|
||||||
```<editorActionHandler action="EditorSelectWord" implementationClass="com.intellij.codeInsight.editorActions.SelectWordHandler"/>```
|
```<editorActionHandler action="EditorSelectWord" implementationClass="com.intellij.codeInsight.editorActions.SelectWordHandler"/>```.
|
||||||
|
|
||||||
Two types of handlers are supported: the ones which are executed once, and the ones which are executed for each caret.
|
Two types of handlers are supported: the ones which are executed once, and the ones which are executed for each caret.
|
||||||
Examples of already implemented handlers can be found in
|
Examples of already implemented handlers can be found in
|
||||||
[this package] (https://github.com/JetBrains/intellij-community/tree/master/platform/lang-impl/src/com/intellij/codeInsight/editorActions).
|
[this package] (https://github.com/JetBrains/intellij-community/tree/master/platform/lang-impl/src/com/intellij/codeInsight/editorActions),
|
||||||
|
e.g. the class
|
||||||
|
[CopyHandler.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/lang-impl/src/com/intellij/codeInsight/editorActions/CopyHandler.java).
|
||||||
|
To implement the logic you need to override ```implement()``` action.
|
||||||
And used like shows the following example:
|
And used like shows the following example:
|
||||||
[EditorHandlerIllustration.java] (https://github.com/JetBrains/intellij-sdk/blob/master/code_samples/editor_basics/src/org/jetbrains/plugins/editor/basics/EditorHandlerIllustration.java)
|
[EditorHandlerIllustration.java] (https://github.com/JetBrains/intellij-sdk/blob/master/code_samples/editor_basics/src/org/jetbrains/plugins/editor/basics/EditorHandlerIllustration.java)
|
||||||
|
|
||||||
@ -120,6 +123,9 @@ TODO
|
|||||||
|
|
||||||
-----------
|
-----------
|
||||||
|
|
||||||
|
### [Sample plugin] (https://github.com/JetBrains/intellij-sdk/tree/master/code_samples/editor_basics)
|
||||||
|
-----------
|
||||||
|
|
||||||
See also
|
See also
|
||||||
[CommonDataKeys.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/CommonDataKeys.java),
|
[CommonDataKeys.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/CommonDataKeys.java),
|
||||||
[DataKey.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/DataKey.java),
|
[DataKey.java] (https://github.com/JetBrains/intellij-community/blob/master/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/DataKey.java),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user