Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add undo / redo buttons to toolbar in Eclipse?

I feel a bit embarrassed asking this questions, but how the heck can I get regular undo/redo buttons into the toolbar of eclipse?

I've often to switch between German and English keyboard layout. Y and Z on those layouts is interchanged and thus I constantly trigger the wrong action for undo / redo. I've observed myself how I figure this without other editors: I just use the toolbars for this operations.

I've already tried Google and such, as well as going through the Customize Perspective dialog, but wasn't able to find what I'm looking for :-(

like image 885
mark Avatar asked May 04 '09 12:05

mark


People also ask

Which toolbar shows the undo and redo buttons?

Alternatively, press “Ctrl” + “Z” on your keyboard. To undo the last few commands, click the drop-down arrow next to the “Undo” button in the Quick Access toolbar. Then select the command to undo. To redo your last undone action, click the “Redo” button in the Quick Access toolbar.

Where are undo and redo buttons available?

To undo an action, press Ctrl + Z. To redo an undone action, press Ctrl + Y.

How do you redo changes in Eclipse?

Ctrl+shift+z should work too. Ctrl-Y should in fact work for eclipse if it's set to the default key bindings. But there should also be a redo entry in the dropdown menu, and it might even show the hotkey.

Where are redo buttons located?

To redo something you've undone, press Ctrl+Y or F4. (If F4 doesn't seem to work, you may need to press the F-Lock key or Fn Key, then F4). If you prefer to use the mouse, click Redo on the Quick Access toolbar. (The Redo button only appears after you've undone an action.)


1 Answers

One way is to use custom plugin. In fact, such custom plugin doesn't need to do anything, only declare new toolbar contribution using existing undo/redo commands.

I've built such plugin for you: http://www.foglyn.com/misc/undoredo_1.0.0.jar. There is absolutely no code, only plugin.xml:

<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin>    <extension          point="org.eclipse.ui.menus">       <menuContribution           locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">             <toolbar                   id="undoredo.toolbar"                   label="Undo/Redo">             <command                   commandId="org.eclipse.ui.edit.undo"                   id="undoredo.undo"                   style="push">             </command>             <command                   commandId="org.eclipse.ui.edit.redo"                   id="undoredo.redo"                   style="push">             </command>          </toolbar>       </menuContribution>    </extension>  </plugin> 

And MANIFEST.MF:

Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: Undoredo Bundle-SymbolicName: undoredo;singleton:=true Bundle-Version: 1.0.0 Bundle-RequiredExecutionEnvironment: J2SE-1.5 Require-Bundle: org.eclipse.ui 

You can download it, and drop into your 'dropins' directory of Eclipse, restart, and you'll see Undo/Redo buttons on your toolbar.

Works for me in Eclipse 3.4 and Eclipse 3.5M7.

like image 169
Peter Štibraný Avatar answered Oct 04 '22 17:10

Peter Štibraný