문제

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
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top