【问题标题】:adding a new button to the toolbar in eclipse 3.7.2在 eclipse 3.7.2 的工具栏中添加一个新按钮
【发布时间】:2014-02-18 11:21:43
【问题描述】:

我正在开发 eclipse 3.7.2(indigo release 2 版本)。与我的工作相关,我需要在 Eclipse 工具栏中添加一个新按钮。 我用谷歌搜索了很多。在所有文件中提到“使用 locationURI:..... 为扩展点创建一个新的菜单贡献“org.eclipse.ui.menus”但是如果我右键单击 org.eclipse.ui.menus-- > 新只有一个选项通用。 org.eclipse.ui.menus--> New--> 中不存在“menucontribute”选项。请为此提出一些解决方案。

最好的问候。

【问题讨论】:

    标签: eclipse eclipse-plugin eclipse-rcp toolbar eclipse-indigo


    【解决方案1】:

    这是一个例子:

    <extension
                point="org.eclipse.ui.menus">
    <menuContribution
                   locationURI="toolbar:org.eclipse.ui.main.toolbar">
                <toolbar
                      id="toolbar_id">
                   <command
                         commandId="command_id"
                         id="toolbarId"
                         label="%toolbar.new"
                         style="push"
                         tooltip="%toolbar.tooltip">
                   </command>
                </toolbar>
    </extension>
    

    您需要提供命令处理程序来对工具栏项的选择做出反应。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-01-05
      • 1970-01-01
      相关资源
      最近更新 更多