How to let the plugin only show when the user right click on project?


I use add-to-group group-id="ProjectViewPopupMenu" , but it always show when user right click on any project file. but i only want it show when user right click project root. how to do it?

1 comment
Comment actions Permalink

You can override AnAction#update in your action, invoke actionEvent.getData(CommonDataKeys.VIRTUAL_FILE) inside, and, depending on the returned virtual file, call actionEvent.getPresentation().setEnabledAndVisible(...).

Please also see


Please sign in to leave a comment.