Add ActionGroup to and Remove ActionGroup from EditorPopupMenu

Answered

Hi Team,

I understand that we can add actions to a given group dynamically. Is it possible to hide/show the group itself dynamically programmatically in a plugin?

 For dynamically adding actions to the group, I'm overriding getChildren() as below.

if (condition) {
    return new AnAction[]{new myAction1(),new myAction2()};
}

return new Action[0];

When the condition is not satisfied and I right click from the editor, I see the action group still being part of the right click menu item but disabled. When no actions can be added (based on a condition), I want to hide the action group (outermenu) itself. How can I get this?

0

Please sign in to leave a comment.