How to add an action group in an action group added by my self.
Answered
I can add a group in "MainGroup" called sample using below code. But unable to
add another group inside that. code added below. How can I add another group
inside a group created by myself.
<actions>
<group id="sample" text="Sample" description="Sample desc">
<add-to-group group-id="MainMenu" anchor="before" relative-to-action="HelpMenu"/>
</group>
<group id="sample.item" text="SampleItem" description="Sample Item">
<add-to-group group-id="sample" anchor="first"/>
<action id="sample.item.add" class="com.xxx.AddAction"
text="Add" description="Sample Add">
<add-to-group group-id="sample.item" anchor="first"/>
</action>
<action id="sample.item.repair" class="com.xxx.RepairAction"
text="Repair" description="Sample Repair">
<add-to-group group-id="sample.item" anchor="after" relative-to-action="sample.item.add"/>
</action>
</group>
</actions>
Please sign in to leave a comment.
Please try this sample:
<actions>
<group id="outer" text="Sample" description="Sample desc">
<add-to-group group-id="MainMenu" anchor="before" relative-to-action="HelpMenu"/>
<action id="a1" class="SampleAction1" text="A1"/>
<action id="a2" class="SampleAction1" text="A2"/>
<action id="b1" class="SampleAction2" text="B1"/>
<separator/>
<group id="inner" text="Inner" popup="true">
<action class="SampleAction1" id="a3" text="A3"/>
<action class="SampleAction2" id="a4" text="A4"/>
</group>
</group>
</actions>
Note: 'popup="true"' is used here to provide "submenu" behavior. By default all actions from 'inner' group would be visually added to 'outer' group.
Thanks @Vassiliy Kudryashov , 'popup="true"' works.
You're welcome!
Hi, it works for a MainMenu but doesn't for the GenerateGroup for instance:
How to make this code also works for context menu ?
@Steph82 your config snippet works for me
Vassiliy, Yes it works in menus but not as I expected in context menu. All is flat : A1, A2, B1, A3, A4.
I would like for instance the same menu like this:
Constructor
toString()
Override
Test...
Copyright
A1 -> B1, B2
A2
A3
A4
B1 and B2 are submenu of A1. I do not succeed to make submenu in context menu.
Regards
Actually "Generate.." is not a context menu but cusom flat list converted from ActionGroup. Actions are copied from ActionGroup to this list recursively.
Thanks for the reply. So what I want to do is impossible in the GenerateGroup :(