是否可以扩展Eclipse Search Menu [英] Is it possible to extend Eclipse Search Menu

查看:137
本文介绍了是否可以扩展Eclipse Search Menu的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在在eclipse中,不可能通过使用eclipse扩展名来扩展由其他插件定义的菜单:
org.eclipse.ui.menus。



我想在搜索中添加一个菜单项,而不是搜索页面。由于菜单搜索是由org.eclipse.search定义的,我无法添加。



但是我看到JDT和CDT在搜索下添加了一些菜单项。任何身体都知道他们如何工作?



任何提示都是赞赏。

解决方案

2012年8月更新,重新编程器 org.eclipse.ui。 actionSets 已被弃用:


而是使用扩展点 org.eclipse。 ui.commasters







答案(2011年8月)



actionSet( extension point =org.eclipse.ui.actionSets / a>)对' menubarPath =org.eclipse.search.menu/d Manuel Selva 推荐的ialogGroup是官方解决方案,符合一般菜单贡献



但请注意,可能仍然持续搜索菜单贡献的问题,如由这个线程围绕(据说是固定的) bug 15684

(这是2009年,希望这个问题已经解决了)


实际上 正在重新定义整个搜索菜单,就像JDT 3.6中目前使用的解决方法一样:




 < extension 
point =org。 eclipse.ui.actionSets>
< actionSet
label =%JavaSearchActionSet.label
description =%JavaSearchActionSet.description
visible =false
id =org.eclipse .jdt.ui.SearchActionSet>
<! - 请参阅http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684 - >
<! - 注意:由于错误,菜单(重新)定义必须在这里: - >
<! - ===================================== ==========================
<! - 搜索菜单 - >
<! - ===================================== ==========================
< menu
label =%searchMenu.label
path =navigate
id =org.eclipse.search.menu>
< groupMarker name =internalDialogGroup/> <! - 不被客户端使用 - >
< groupMarker name =dialogGroup/> <! - 要由客户使用 - >
< separator name =fileSearchContextMenuActionsGroup/> <! - 要由客户使用 - >
< separator name =contextMenuActionsGroup/> <! - 要由客户使用 - >
< separator name =occurencesActionsGroup/> <! - 要由客户使用 - >
< separator name =extraSearchGroup/> <! - 要由客户使用 - >
< / menu>
<! - (...) - >


right now in eclipse it is not possible to extend Menu defined by Other plugins by using eclipse extension: org.eclipse.ui.menus.

I want to add one menu item in Search but not a search page. since the Menu Search is defined by org.eclipse.search, I cannot add it.

but I see JDT and CDT do add some menu item under search. does any body know how they make it work?

any hint is appreciated.

解决方案

Update August 2012, as commented by reprogrammer, org.eclipse.ui.actionSets is deprecated:

Instead, use the extension point org.eclipse.ui.commands.


Original answer (August 2011)

The actionSet (extension point="org.eclipse.ui.actionSets") with an action on 'menubarPath="org.eclipse.search.menu/dialogGroup"' recommended by Manuel Selva is the official solution, in line with general menu contribution.

But beware of some issue that might still lingering for Search menu contribution, as illustrated by this thread around the (supposedly fixed) bug 15684:
(it was in 2009, hopefully the issue has been addressed since)

What actually does work is redefining the whole Search Menu as in the workaround that is still currently used in JDT 3.6:

   <extension
         point="org.eclipse.ui.actionSets">
      <actionSet
            label="%JavaSearchActionSet.label"
            description="%JavaSearchActionSet.description"
            visible="false"
            id="org.eclipse.jdt.ui.SearchActionSet">
<!-- see http://bugs.eclipse.org/bugs/show_bug.cgi?id=15684    -->
<!-- Note: The menu (re-) definition has to be here due to bug: -->
<!-- =================================================================== -->
<!-- Search Menu                                                         -->
<!-- =================================================================== -->
         <menu
               label="%searchMenu.label"
               path="navigate"
               id="org.eclipse.search.menu">
                <groupMarker name="internalDialogGroup"/>   <!-- not to be used by clients  -->
                <groupMarker name="dialogGroup"/>           <!-- to be used by clients      -->
                <separator name="fileSearchContextMenuActionsGroup"/> <!-- to be used by clients      -->
                <separator name="contextMenuActionsGroup"/> <!-- to be used by clients -->
                <separator name="occurencesActionsGroup"/> <!-- to be used by clients -->
                <separator name="extraSearchGroup"/> <!-- to be used by clients -->
         </menu>
<!-- (...) -->

这篇关于是否可以扩展Eclipse Search Menu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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