Menu Context Depending on Project

HI
I want to have different menu actions depending on plugin state per project. There are some changes during time/events and it's work just great while there is one opened project. But when there are more I just can not manipulate with ActionManager and ActionGroups. How can I solve it?

4 comments
Comment actions Permalink

Hi Stanislav,

You can configure a menu entries one time and provide corresponding logic at the AnAction.update() method for your actions. Then you can instruct the IDE to not show it by calling AnActionEvent.getPresentation.setVisible(false)

Denis

0
Comment actions Permalink

Thanks for reply.
Is there are any guaranties that it will be invoked on project switch?

0
Comment actions Permalink

update() method is guaranteed to be called before the action is displayed.

Denis

0
Comment actions Permalink

Thanks a lot.  Your answers were very helpful.

0

Please sign in to leave a comment.