如何在Eclipse中将撤消/重做按钮添加到工具栏? [英] How to add undo / redo buttons to toolbar in Eclipse?
问题描述
我觉得有点尴尬的问这个问题,但是如何才能在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?
我经常去切换德文和英文键盘布局。这些布局上的 Y 和 Z 被互换,因此我不断触发撤消/重做的错误操作。我已经观察了自己,如果没有其他的编辑,我是如何得出的:我只是使用工具栏进行这个操作。
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.
我已经尝试过Google,以及去通过自定义透视对话框,但无法找到要查找的内容: - (
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 :-(
推荐答案
实际上,这样的自定义插件不需要做任何事情,只能使用现有的撤消/重做命令声明新的工具栏贡献。
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.
我已经建立您可以使用这样的插件: http://www.foglyn.com/misc/undoredo_1.0.0。 jar ,绝对没有代码,只有plugin.xml:
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>
和MANIFEST.MF:
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
您可以下载它,并放入Eclipse的dropins目录中,重新启动,您将在工具栏上看到撤消/重做按钮。
You can download it, and drop into your 'dropins' directory of Eclipse, restart, and you'll see Undo/Redo buttons on your toolbar.
在Eclipse 3.4和Eclipse 3.5M7中为我工作。
Works for me in Eclipse 3.4 and Eclipse 3.5M7.
这篇关于如何在Eclipse中将撤消/重做按钮添加到工具栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!