Question

I have a command to launch views configured in plugin.xml of an RCP application module as follows:

<extension 
     point="org.eclipse.ui.commands">
      <command
            defaultHandler="myapp.commandhandler.LaunchView"
            id="myapp.command.launchview"
            name="Map">
      </command>
   </extension>

I have configured this command to be shared across a couple of menu extensions like this:

  <menuContribution
            allPopups="false"
            locationURI="menu:org.eclipse.ui.main.menu">
         <menu
               id="myapp.application.menu.showview"
               label="Show View">
            <command
                  commandId="myapp.command.launchview"
                  label="Map"
                  style="push">
            </command>
            <command
                  commandId="myapp.command.launchview"
                  label="Legend"
                  style="push">
            </command>           
         </menu>
 </menuContribution>

Now I want to pass a command parameter representing each view's ID, similar to what is being done here Eclipse RCP commands.

But when I add these parameter configurations, these menu items disappear from the main menu. Any ideas?

Était-ce utile?

La solution

Menu item will disappear from menu if the commandId or commandParameter it is bound to does not exist.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top