How to disable build-in actions?


I am writing a plugin to customize the project structure. So I want the build-in actions such as ‘New File’ and ‘New Directory’ are only visible for some specific directories. How to do it?

1 comment


There is no recommended way to do this.

Technically, you can use ActionManager to manage actions (replacing, unregistering, etc.) and there is com.intellij.dynamicActionConfigurationCustomizer (com.intellij.openapi.actionSystem.impl.DynamicActionConfigurationCustomizer) extension point that allows doing it on plugin load/unload. Existing actions can be overridden to customize the update methods. Such actions can replace existing ones via ActionManager.

The problem is that these actions are crucial to the work of every developer using the IDE and replacing them with custom logic can destroy the IDE experience when they are buggy.


Please sign in to leave a comment.