Defining action 'showing range' on right-click

I've created an action to create new files and attached it to the right click menu: 'New'. How to define range/scope to this action to show only when I right-click on a package or module or simply a file within module ? I don't want to show it when somebody clicks on, for example '.idea' folder.

I've registerd my action to New menu with:

<action id="pl.Creator" text="New Base" description="Creates New Files From Templates" icon="/icons/icon.png">
     <add-to-group group-id="NewGroup" relative-to-action="NewFile" anchor="after" />
</action>

2 comments
Comment actions Permalink

Hello,

You should implement AnAction.update() accordingle, i.e. disable it in case of inappropriate context.

Denis

0
Comment actions Permalink

Thanks x]

0

Please sign in to leave a comment.