u123
u123

Reputation: 16329

Specifying locationURI for new Eclipse toolbar?

I have created a toolbar my.toolbar that I would like to add after the "navigate toolbar" containing the: previous annotation, next annotation, back, and forward - buttons.

I have tried the following locationURIs (based on info from the Plug-in Spy):

locationURI="toolbar:org.eclipse.ui.main.toolbar?after=navigate"
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=org.eclipse.ui.workbench.navigate"
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=toolbar:org.eclipse.ui.workbench.navigate"

But either the my.toolbar (with my command) does not show up or it shows up BEFORE the navigate toolbar. Any ideas?

Below is my extension point:

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.main.toolbar?after=navigate">
         <toolbar
               id="my.toolbar">
            <command
                  commandId="my.command"
                  icon="images/img.png"
                  id="my.toolbar"
                  style="push">
            </command>
         </toolbar>
      </menuContribution>
   </extension>

Upvotes: 2

Views: 2744

Answers (1)

HRJ
HRJ

Reputation: 17797

You can use the Plug-in Menu Spy to find the locationURI.

Just press Alt+Shift+F2 to trigger the Menu Spy and click a toolbar button. A popup dialog will show all details including the locationURI

Upvotes: 3

Related Questions