0

How can I add the menuListener to the menus generated by the following xml so that I can do something when the focus is on a specific menu (not clicked yet).

<extension
         point="org.eclipse.ui.editorActions">
      <editorContribution
            targetID="net.sourceforge.texlipse.TexEditor"
            id="net.sourceforge.texlipse.editor.editorContribution">
         <menu
               label="&amp;TTS Settings"
               id="net.sourceforge.texlipse.menus.tts">
            <separator name="sourceGroup"/>
            <separator name="latexGroup"/>
            <separator name="commentGroup"/>
            <separator name="spellGroup"/>
         </menu>     

          <action
                class="net.sourceforge.texlipse.actions.TTSPdfModeAction"
                icon="icons/start.png"
                id="net.sourceforge.texlipse.actions.TTSPdfModeAction"
                definitionId="net.sourceforge.texlipse.commands.PDF"
                label="&amp;PDF"
                menubarPath="net.sourceforge.texlipse.menus.tts/sourceGroup"
                style="push"
                toolbarPath="latexGroup"
                tooltip="PDF"/>                                       
           <action
                class="net.sourceforge.texlipse.actions.TTSStopAction"
                icon="icons/stop.png"
                id="net.sourceforge.texlipse.actions.TTSStopAction"
                definitionId="net.sourceforge.texlipse.commands.TTSStop"
                label="&amp;Stop"
                menubarPath="net.sourceforge.texlipse.menus.tts/sourceGroup"
                style="push"
                toolbarPath="latexGroup"
                tooltip="Stop"/>      
      </editorContribution>
   </extension>
  • The SWT MenuListener is only called when the menu is shown and hidden, it doesn't provide focus events. – greg-449 Jan 20 '18 at 21:37
  • @greg-449 yes, i want to trigger an event when the menu is shown, in other words when i open the menu and navigate with the help of arrow keys, then on each menu focus, i want to associate an event – user3820414 Jan 21 '18 at 08:06
  • To the best of my knowledge that isn't possible. – greg-449 Jan 21 '18 at 08:08

0 Answers0