java - Actions in NetBeans module - context menu, main menu -


i developing netbeans module , have declared action (using annotations, translated layer.xml record) works custom project type (esperproject class):

@actionid(category = "run", id = "my.package.runesperaction") @actionregistration(displayname = "my action", asynchronous=true) @actionreferences({     @actionreference(path = "menu/buildproject", position = 0) }) public final class runesperaction implements actionlistener {      private final esperproject project;      public runesperaction(esperproject project) {         this.project = project;     }      @override     public void actionperformed(actionevent ev) {        // sth project     } } 

i can run action buildproject menu (which actualy run menu), cannot make work in 2 cases need (both called asynchronously declared in annotation):

  1. i'd run action project context menu.
  2. i need have action triggered when esperproject run main menu item "run main project".

thanks suggestions.

1.i'd run action project context menu.

it possible adding @actionreference(path = "project/actions", position = 0) @actionreferences


Comments