How to programmatically disable/enable a group of actions?



I have two actions which are used to launch Gradle tasks in background (non blocking actions).

These actions are chaining several gradle tasks (with some of them common, for instance one is dedicated to build binaries, the other one to build and upload binaries in the target device).

I referenced these two actions in a group (in plugin.xml)

I want to disable all actions (I mean the group), when one in launched (to avoid build conflict and avoid relaunching the same action while the current one is not finished).

How can I achive this?

Thanks a lot for your help.

Comment actions Permalink

You need a central place (per Project, Project Service?) to store current status and then use this information in com.intellij.openapi.actionSystem.AnAction#update

Comment actions Permalink

Hello Yann,

Thanks for your solution, I created a project service to manage action status and it works!


Please sign in to leave a comment.