Run custom plugin from context menu

Hi all,

I have to migrate an eclipse plugin to a intelliJ plugin

This custom plugin must trigger preconfigured maven commands.

My question is about the contextual menu : the different commands should be available by right clicking on evey pom.xml files from project

Screenshot below (eclipse version)

Can you give me hints on what to do to bind the plugin commands to the context menu only for pom.xml files , since I am pretty new to IntelliJ ?


1 comment
Comment actions Permalink

You can make action (or action group) invisible depending on context.


public void update(AnActionEvent e) {
VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
boolean visible = file != null && file.getName().equals("pom.xml");

Please sign in to leave a comment.