开发eclipse插件遇到一个问题

我在开发一款eclipse插件,需要在package explorer、project explorer、navigator视图的右键菜单中添加一个菜单项,遇到一个问题是在package explorer和navigator视图中菜单项能显示出来并正常使用,但是在project explorer视图里却显示不出来。请问各位大神是什么原因?
action类的定义:

   public class DfbdExportFileAction extends Action implements IViewActionDelegate, IActionDelegate, IWorkbenchWindowActionDelegate

plugin.xml中扩展点定义:

    <!-- contexts -->
<extension
    point="org.eclipse.ui.popupMenus">
    <viewerContribution
        id="com.dfbd.exportfiles.contextmenu.PackageExplorer"
        targetID="org.eclipse.jdt.ui.PackageExplorer">
        <menu
            id="org.eclipse.jdt.ui.PackageExplorer.DfbdExportFile"
            label="aa">
        </menu>
        <action
            icon="icons/icon-1.png"
            label="DFBD Export Files"
            name="DFBD Export Files"
            menubarPath="org.eclipse.jdt.ui.PackageExplorer.DfbdExportFile"
            class="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction"
            id="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction.PackageExplorer"
            enablesFor="+">
        </action>
    </viewerContribution>
    <viewerContribution
        id="com.dfbd.exportfiles.contextmenu.ProjectExplorer"
        targetID="org.eclipse.ui.navigator.ProjectExplorer">
        <menu
            id="org.eclipse.ui.navigator.ProjectExplorer.DfbdExportFile"
            label="bb">
        </menu>
        <action
            icon="icons/icon-1.png"
            label="DFBD Export Files"
            name="DFBD Export Files"
            menubarPath="org.eclipse.ui.navigator.ProjectExplorer.DfbdExportFile"
            class="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction"
            id="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction.ProjectExplorer">
        </action>
    </viewerContribution>
    <!-- 这个也能正确显示 -->
    <viewerContribution
        id="com.dfbd.exportfiles.contextmenu.ResourceNavigator"
        targetID="org.eclipse.ui.views.ResourceNavigator">
        <menu
            id="org.eclipse.ui.views.ResourceNavigator.DfbdExportFile"
            label="cc">
        </menu>
        <action
            icon="icons/icon-1.png"
            label="DFBD Export Files"
            name="DFBD Export Files"
            menubarPath="org.eclipse.ui.views.ResourceNavigator.DfbdExportFile"
            class="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction"
            id="com.dfbd.exportfiles.contextmenu.DfbdExportFileAction.ResourceNavigator"
            enablesFor="+">
        </action>
    </viewerContribution>
</extension>

1个回答

路径问题,看看改成绝对路径试试

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问