Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add buttons to the Eclipse toolbar?

Tags:

eclipse

I'm on about my sixth version of Eclipse now, but I've never been able to work out how to add a button to the toolbar.
For example, by default I have a little "open type" button in the Java perspective, and I would like to add an "open type hierarchy" button right next to it. Both functions are available right next to each other on the Navigate menu, and I would simply like to drag one of them onto a toolbar as well.

Doesn't seem so far fetched to me? I've tried the "customize perspective" by right-clicking the toolbars, but to no avail. I seem to be able to add stuff that I don't want. Any ideas? I happen to be using Eclipse 3.4.2 M20081224-0800, but I've never gotten anywhere with this in multiple versions.

Thank you.

like image 418
Josh Avatar asked Mar 25 '09 11:03

Josh


People also ask

How do I add a toolbar to the Eclipse menu?

Set the location URI to "toolbar:org.eclipse.ui.main.toolbar". Add a toolbar to your menu contribution. Add the command "de.vogella.rcp.intro.commands.toolbar.Hello" to the toolbar.

How to add undo/redo toolbar buttons in Eclipse?

By default, there are no Undo/Redo toolbar buttons in the Eclipse toolbar. With Eclipse as an open and extensible framework, how do you add them? - Undo and Redo Toolbar Buttons in Eclipse Toolbar buttons in Eclipse are configured through the menu Window > Customize Perspective.

Is there an external tools button in Eclipse Helios toolbar?

This user is third on the weekly GitLab leaderboard. Show activity on this post. There is a button called external tools button in the new eclipse Helios toolbar It is easy to customize. I use it for run ant build by single click I guess it will useful try it

How do I add an Eclipse plugin to my website?

Click on the plugin.xml and select the Extensions tab. Press the Add…​ button. Search for the extension "org.eclipse.ui.commands". Select it and press finish.


1 Answers

The trick with "Customize perspective" is that only reflects 'plugin.xml' org.eclipse.ui.commands contribution points.

In other word, you can activate/deactivate those extension points, not change them.

As described in this message (for another button):

As far as I know, the so-called 'basic' toolbar cannot be configured by the user.

I think there are 2 ways to add the 'save all' button:

  • write a plug-in that adds a new toolbar section containing the 'save all' button
  • patch the plug-in 'org.eclipse.ui.ide': in the class WorkbenchActionBuilder insert the following line after the line # 374 (if you want it to appear between 'save' and 'print'):
fileToolBar.add(saveAllAction);

Eclipse3.5 might have changed that, though.

like image 59
VonC Avatar answered Oct 25 '22 09:10

VonC