How to add action groups dynamically in a custom action group programmatically?
Answered
I customized an action group. My menu is dynamically generated according to the folder structure.
Encountered a file creation operation, this has been achieved,
But sometimes it is a folder, and you need to create an action group dynamically.
And recursively add children to this action group,
Except for the outermost action group defined in plugin.xml, everything else needs to be dynamically created and the path to the menu can be obtained.
<actions>
<group id="actions.DynamicActionGroup" class="actions.DynamicActionGroup" text="my action group"
popup="true" icon="/image/logo.svg">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
</group>
</actions>
Please sign in to leave a comment.
Resolved, execute:
public class DynamicActionGroup extends ActionGroup {public DynamicActionGroup(String dirPath) {
super("name", true);
}
}