mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-28 01:07:49 +08:00
[md] register group of actions applied
This commit is contained in:
parent
74694be5ab
commit
e8776bd347
@ -177,7 +177,6 @@ After compiling and running the plugin project and invoking the action, the dial
|
||||
|
||||
-------------
|
||||
|
||||
**Under construction**
|
||||
#Groupping actions.
|
||||
|
||||
If some part of the functionality requires to implement several actions or actions are simply too many and overload the menu they can be joined into groups.
|
||||
@ -200,10 +199,30 @@ class.
|
||||
IntelliJ IDEA has embedded inspection an quick fix for registering groups of actions.
|
||||
After the group has been created it's declaration should be highlighted. Place caret on group's class name declaration and press
|
||||
***Alt + Enter***
|
||||
to register it.
|
||||
to register it:
|
||||
|
||||

|
||||
|
||||
In this sample our custom action group will be available in the editor popup menu:
|
||||
|
||||

|
||||
|
||||
After filling the "New Action" form and applying the changes *<actions>* section of the
|
||||
[plugin.xml]()
|
||||
file will look like this:
|
||||
|
||||
<actions>
|
||||
<group id="org.jetbrains.tutorials.actions.SimpleGroup" class="org.jetbrains.tutorials.actions.SimpleGroup"
|
||||
text="Simple Action Group" description="Action Group Demo">
|
||||
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
|
||||
</group>
|
||||
</actions>
|
||||
|
||||
|
||||
-------------
|
||||
|
||||
**Under construction**
|
||||
|
||||
placing <group> attribute into
|
||||
[plugin.xml] (https://github.com/JetBrains/intellij-sdk/blob/master/code_samples/plugin_sample/META-INF/plugin.xml)
|
||||
file. In most of the cases you simply need to leave "class" attribute of the <group> undefined; in this case an instance of
|
||||
|
BIN
tutorials/action_system/img/editor_popup_menu.png
Normal file
BIN
tutorials/action_system/img/editor_popup_menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 204 KiB |
BIN
tutorials/action_system/img/scr/editor_popup_menu.png
Normal file
BIN
tutorials/action_system/img/scr/editor_popup_menu.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 189 KiB |
Loading…
x
Reference in New Issue
Block a user