submenu under the [b]Contextual Menu of the DITA Maps Manager[/b]

Post here questions and problems related to oXygen frameworks/document types.
vishwavaranasi
Posts: 112
Joined: Fri Feb 28, 2020 4:02 pm

submenu under the [b]Contextual Menu of the DITA Maps Manager[/b]

Post by vishwavaranasi »

Hello Team , we wanted to have our own submenu under the Contextual Menu of the DITA Maps Manager
image.png
image.png (20.97 KiB) Viewed 712 times
We have tried editing the as below

but it is not adding to the Contextual Menu of the DITA Maps Manager
image.png
image.png (63.21 KiB) Viewed 712 times
Thanks,
vishwa
Radu
Posts: 8395
Joined: Fri Jul 09, 2004 5:18 pm

Re: submenu under the [b]Contextual Menu of the DITA Maps Manager[/b]

Post by Radu »

Hi,

When you edit a framework configuration in the Preferences->"Document Type Associations" page and edit actions in the "Author" tab you only influence XML documents opened in the main editor in the Author visual editing mode. So you influence a DITA Map only if opened in a DITA Map.
For DITA Maps opened in the DITA Maps Manager you cannot use the framework configuration to customize the popup menu.
You do have API to customize the popup menu in the DITA Maps Manager view but only from a Workspace Access Oxygen Java plugin:
https://github.com/oxygenxml/sample-plu ... ace-access

Something like:

Code: Select all

    @Override
    public void applicationStarted(StandalonePluginWorkspace pluginWorkspaceAccess) {
      pluginWorkspaceAccess.addEditorChangeListener(new WSEditorChangeListener() {
        @Override
        public void editorOpened(URL editorLocation) {
          WSDITAMapEditorPage ditaMapEditorPage = (WSDITAMapEditorPage) pluginWorkspaceAccess.getEditorAccess(editorLocation, PluginWorkspace.DITA_MAPS_EDITING_AREA);
          ditaMapEditorPage.setPopUpMenuCustomizer(new DITAMapPopupMenuCustomizer() {
            
            @Override
            public void customizePopUpMenu(Object popUp, AuthorDocumentController ditaMapDocumentController) {
              JPopupMenu menu = (JPopupMenu) popUp;
              AuthorNode[] selectedNodes = ditaMapEditorPage.getSelectedNodes(true);
              ditaMapDocumentController.insertXMLFragment("", selectedNodes[0].getStartOffset());
            }
          });
        };
      }, PluginWorkspace.DITA_MAPS_EDITING_AREA);
    }
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
KevinGarcia99
Posts: 1
Joined: Fri Nov 11, 2022 7:48 pm

Re: submenu under the [b]Contextual Menu of the DITA Maps Manager[/b]

Post by KevinGarcia99 »

Hi Radu, when I tried what you suggest I'm getting the following error when I open Oxygen:
image.png
image.png (22.72 KiB) Viewed 423 times
Am I importing the wrong editor or something like that?
Last edited by KevinGarcia99 on Thu Nov 24, 2022 5:56 am, edited 1 time in total.
Post Reply