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

Answered

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 http://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html

0

Please sign in to leave a comment.