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?
Please sign in to leave a comment.
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
Thanks for reply.
Is there are any guaranties that it will be invoked on project switch?
update() method is guaranteed to be called before the action is displayed.
Denis
Thanks a lot. Your answers were very helpful.