Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Add a menu command to a toolbar?
Add a menu command to a toolbar? [message #756266] Fri, 11 November 2011 17:51 Go to next message
Tom  is currently offline Tom Friend
Messages: 16
Registered: April 2010
Junior Member
Is there any way to add an EXISTING MENU COMMAND to an EXISTING TOOLBAR in Eclipse 3.7?

All the examples either show you how to hide/unhide existing toolbar items (which is not what I am asking) or are programming examples for people writing Eclipse plugins (which is also not what I am asking.)

It seems like it should be possible to add an existing MENU item (like, say, "Organize Imports" to an existing toolbar. Is the only way to do this by writing a custom toolbar????
Re: Add a menu command to a toolbar? [message #756820 is a reply to message #756266] Tue, 15 November 2011 09:40 Go to previous messageGo to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 222
Registered: July 2009
Location: Graz, Austria
Senior Member
If you want to do it by customizing the menu as a user I guess this will not work. If you want to provide a custom plugin you might be searching for something like this:

plugin.xml
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            allPopups="false"
            locationURI="toolbar:org.eclipse.ui.workbench.file?after=additions">
         <command
               commandId="org.eclipse.pde.ui.searchTargetRepositories"
               style="push">
         </command>
      </menuContribution>
   </extension>

</plugin>


This plugin will add the searchTargetRepositories command to the existing file toolbar.
Re: Add a menu command to a toolbar? [message #757004 is a reply to message #756820] Tue, 15 November 2011 22:46 Go to previous message
Tom  is currently offline Tom Friend
Messages: 16
Registered: April 2010
Junior Member
Thanks. It seems odd that there's no way to do this from inside the app, but I guess that made sense to someone.
Previous Topic:How can I use EMF/GMF/Xpand to produce objective-c (iphone) code?
Next Topic:JavaFX 2.0
Goto Forum:
  


Current Time: Tue Jun 22 19:57:28 GMT 2021

Powered by FUDForum. Page generated in 0.03089 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top