Syam
Syam

Reputation: 1212

Location URI's for action sets

I want to add menu and toolbar item in the eclispe using the commands.

I want to add menu item after the Run -> External Tools menu item and toolbar action also after the External Tools action.

I have used below Location URI's but they are not helping.

for the Menu Item : menu:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar

for the toolbar action : toolbar:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar

My plug-in.xml snippet appears as shown below.

<extension
     point="org.eclipse.ui.menus">
  <menuContribution
        locationURI="toolbar:org.eclipse.debug.ui.launchActionSet?after=org.eclipse.ui.externaltools.ExternalToolMenuDelegateToolbar">
     <command
           commandId="com.sample.uvextensions.commands.sampleCommand"
           icon="icons/sample.gif"
           id="com.sample.uvextensions.toolbars.sampleCommand"
           label="Debug UV Project"
           style="push"
           tooltip="launches keil&apos;s debug session for selected project">
     </command>
  </menuContribution>
  <menuContribution
        locationURI="menu:org.eclipse.debug.ui.launchActionSet">
     <command
           commandId="com.sample.uvextensions.commands.sampleCommand"
           icon="icons/sample.gif"
           id="com.sample.uvextensions.menus.sampleCommand"
           label="Debug UV Project"
           style="push"
           tooltip="launches keil&apos;s debug session for selected project">
     </command>
  </menuContribution>

Any pointers will be greatly helpfull for me.

Thanks in Advance.

Upvotes: 1

Views: 998

Answers (1)

Martti K&#228;&#228;rik
Martti K&#228;&#228;rik

Reputation: 3621

Menu contributions can't refer to action sets because actions sets are processed after menu contributions and are not visible for the former.

You can declare your own action set and add actions with the same menubarPath ("org.eclipse.ui.run/ExternalToolsGroup") and toolbarPath ("org.eclipse.debug.ui.launchActionSet/debug") as those in the external tools plugin. To get your actions placed after those from the other plugin, make sure your action set ID is greater than "org.eclipse.ui.externaltools.ExternalToolsSet".

Upvotes: 2

Related Questions