How do I add an action to a the popup menu of the Java editor?

Apache NetBeans Wiki Index

Note: These pages are being reviewed.

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.

  1. On the first tab, choose Conditionally Enabled action and select EditorCookie as the cookie class.

  2. On the second tab, check Editor Context Menu Item and choose MIME type (text/x-java in this case) and position.

OR use

for an action with the `EditorCookie` as context object