DevFaqActionAddEditorPopup
How do I add an action to a the popup menu of the Java editor?
The simplest way is to run New Action Wizard (File > New... > Module Development > Action) which creates an action for you and registers it in your layer.xml.
- On the first tab, choose Conditionally Enabled action and select EditorCookie as the cookie class.
- On the second tab, check Editor Context Menu Item and choose MIME type (text/x-java in this case) and position.
You can also declare your action in your layer manually:
<folder name="Editors">
<folder name="text">
<folder name="x-java">
<folder name="Popup">
<file name="org-mymodule-MyAction.instance"/>
</folder>
</folder>
</folder>
</folder>
You can also use Editors/Popup/ to add an action to all editor kits.
See also:
- How do I add an action to a file of a given mime-type?
- How do I add an action to a folder?
- How do I add an action to the text-editor popup menu?
- How do I add an action to the NetBeans menu bar?
- How do I add an action to the NetBeans tool bar?
- How do I add an action to my custom node?

