11function applicationStarted ( pluginWorkspaceAccess ) {
22 Packages . java . lang . System . err . println ( "Application started " + pluginWorkspaceAccess ) ;
3- edChangedListener = {
4- /*Called when a document is opened*/
5- editorOpened : function ( editorLocation ) {
6- Packages . java . lang . System . err . println ( "\nrunning " + editorLocation ) ;
7- /*Get the opened DITA Map*/
8- editor = pluginWorkspaceAccess . getEditorAccess ( editorLocation , Packages . ro . sync . exml . workspace . api . PluginWorkspace . MAIN_EDITING_AREA ) ;
9- textPage = editor . getCurrentPage ( ) ;
10- /*Add listener called when right click is performed in the DITA Maps manager view*/
3+
4+ /*Add listener called when right click is performed in the text page*/
115 customizerObj = {
12- customizePopUpMenu : function ( popUp , textPage ) {
6+ customizeTextPopUpMenu : function ( popUp , textPage ) {
137 Packages . java . lang . System . err . println ( "RIGHT CLICK" + popUp ) ;
148 try {
159 /*Create absolute reference*/
@@ -34,14 +28,9 @@ function applicationStarted(pluginWorkspaceAccess) {
3428 }
3529 }
3630 }
37-
38- textPage . addPopUpMenuCustomizer ( new Packages . ro . sync . exml . workspace . api . editor . page . text . TextPopupMenuCustomizer ( customizerObj ) ) ;
39- }
40- }
41- edChangedListener = new JavaAdapter ( Packages . ro . sync . exml . workspace . api . listeners . WSEditorChangeListener , edChangedListener ) ;
42- pluginWorkspaceAccess . addEditorChangeListener (
43- edChangedListener ,
44- Packages . ro . sync . exml . workspace . api . PluginWorkspace . MAIN_EDITING_AREA ) ;
31+
32+ //Add the popup menu customizer.
33+ pluginWorkspaceAccess . addMenusAndToolbarsContributorCustomizer ( new JavaAdapter ( Packages . ro . sync . exml . workspace . api . standalone . actions . MenusAndToolbarsContributorCustomizer , customizerObj ) ) ;
4534}
4635
4736function applicationClosing ( pluginWorkspaceAccess ) {
0 commit comments