如何添加按钮到Eclipse工具栏? [英] How do I add buttons to the Eclipse toolbar?

查看:419
本文介绍了如何添加按钮到Eclipse工具栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在在关于我的第六版Eclipse,但是我从来没有能够解决如何在工具栏上添加一个按钮。

例如,默认情况下我有一点Java透视图中的打开类型按钮,我想在其旁边添加一个打开类型的层次结构按钮。这两个功能都可以在Navigate菜单上相互提供,我只想将其中一个拖到工具栏上。

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.

似乎没有对我来说很牵强?我通过右键单击工具栏尝试了自定义视角,但无效。我似乎能够添加我不想要的东西。有任何想法吗?我恰好是使用 Eclipse 3.4.2 M20081224-0800 ,但我从来没有在多个版本中随处可见。

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.

谢谢。

推荐答案

自定义透视是只反映'plugin.xml' org.eclipse.ui.commands 贡献点。

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 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:


  • 编写一个插件,添加一个新的工具栏部分,其中包含保存所有按钮

  • 修补插件' org.eclipse.ui.ide ':
    在类 WorkbenchActionBuilder 中插入以下行
    行#374(如果你想要显示在'保存'和'打印'之间):

  • 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 可能已经改变了。

Eclipse3.5 might have changed that, though.

这篇关于如何添加按钮到Eclipse工具栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆