Eclipse插件项目资源管理器上下文菜单 [英] Eclipse plugin project explorer context menu

查看:833
本文介绍了Eclipse插件项目资源管理器上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是PackageExplorer的plugin.xml工作上下文菜单的一部分,现在我想要它为ProjecExplorer,所以我尝试重写它到ProjectExplorer,但它不工作..我搜索网页,发现这是问题,但是我找不到工作解决方案。有没有任何经验如何修复?

 < extension point =org.eclipse.ui.menus> 
< menuContribution locationURI =popup:org.eclipse.jdt.ui.PackageExplorer>
< command commandId =app.LoadXml
label =Load planstyle =pushmnemonic =L>
< visibleWhen>
< with variable =activeMenuSelection>
< iterate ifEmpty =false>
< adapt type =org.eclipse.core.resources.IResource>
< test property =org.eclipse.core.resources.namevalue =*。xml/>
< / adapt>
< / iterate>
< / with>
< / visibleWhen>
< / command>
< / menuContribution>
< / extension>

我不工作的解决方案 - 将PackageExploer重命名为ProjectExplorer =>现在的上下文菜单。

 < extension point =org.eclipse.ui.menus> 
< menuContribution locationURI =popup:org.eclipse.jdt.ui.ProjectExplorer>
< command commandId =app.LoadXml
label =Load planstyle =pushmnemonic =L>
< visibleWhen>
< with variable =activeMenuSelection>
< iterate ifEmpty =false>
< adapt type =org.eclipse.core.resources.IResource>
< test property =org.eclipse.core.resources.namevalue =*。xml/>
< / adapt>
< / iterate>
< / with>
< / visibleWhen>
< / command>
< / menuContribution>
< / extension>


解决方案

在第二部分使用的位置URI是错误的。 / p>

locationURI =popup:org.eclipse.jdt.ui.ProjectExplorer



检查此处

 
项目资源管理器org.eclipse.ui.navigator.ProjectExplorer

项目org.eclipse.jdt.ui.ProjectsView


This is part of plugin.xml working context menu for PackageExplorer now I wanted it for ProjecExplorer, so I tried rewrite it to ProjectExplorer but It doesn't work .. I searched the web and found that are problem with that, but I couldn't find working solution. Does anybony experience how to fix do it?

    <extension point="org.eclipse.ui.menus">
    <menuContribution locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
      <command commandId="app.LoadXml"
        label="Load plan" style="push" mnemonic="L">
         <visibleWhen>
                <with variable="activeMenuSelection">
                    <iterate ifEmpty="false">
                        <adapt type="org.eclipse.core.resources.IResource">
                                <test property="org.eclipse.core.resources.name" value="*.xml" />
                        </adapt>
                    </iterate>
                </with>
         </visibleWhen>
      </command>
    </menuContribution>
  </extension>

My not working solution - renamed PackageExploer to ProjectExplorer => now context menu.

<extension point="org.eclipse.ui.menus">
    <menuContribution locationURI="popup:org.eclipse.jdt.ui.ProjectExplorer">
      <command commandId="app.LoadXml"
        label="Load plan" style="push" mnemonic="L">
         <visibleWhen>
                <with variable="activeMenuSelection">
                    <iterate ifEmpty="false">
                        <adapt type="org.eclipse.core.resources.IResource">
                                <test property="org.eclipse.core.resources.name" value="*.xml" />
                        </adapt>
                    </iterate>
                </with>
         </visibleWhen>
      </command>
    </menuContribution>
  </extension>

解决方案

location URI used in the second part is wrong.

locationURI="popup:org.eclipse.jdt.ui.ProjectExplorer"

Check here

Project Explorer      org.eclipse.ui.navigator.ProjectExplorer

Projects              org.eclipse.jdt.ui.ProjectsView

这篇关于Eclipse插件项目资源管理器上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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