Add Custom Actions to the Contextual Menu?

Question

How do I add my own custom actions to the contextual menu using an API?

Answer

The WSTextEditorPage.addPopUpMenuCustomizer API method allows you to customize the contextual menu shown in Text mode.