How do I create an action which can be invoked by a macro?

Apache NetBeans Wiki Index

Note: These pages are being reviewed.

Use @EditorActionRegistration!

@NbBundle.Messages({ "CTL_MyAction=Let's go", "macro-name=Let's go" })
@EditorActionRegistration(
	name = "macro-name",
	mimeType = "text/x-java",
	menuPath = "Source", menuPosition = 0, menuText = "#CTL_MyAction")
public class MyAction extends org.netbeans.editor.BaseAction {
 //...
}

Then your action can be invoked by a macro (and even recorded by the macro recorder)