Just register an instance of the action in your XML layer under Projects/Actions/. It should be a ContextSensitiveAction, such as a CookieAction.

Only possible as of NB 4.2

Source: NetBeans FAQ