Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 336016

Summary: [CommonNavigator] No menu in ProjectManager when use MenuContribution
Product: [Eclipse Project] Platform Reporter: michel Labarre <michel.labarre>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED INVALID QA Contact: Francis Upton IV <francisu>
Severity: normal    
Priority: P3 CC: prakash, pwebster
Version: 3.6   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description michel Labarre CLA 2011-02-01 15:43:16 EST
Hello 
I have added a menu contribution in the popup menu of PackageExplorer. It appears correctly (first menuContribution in the following XML). Then I try  to do the same thing into Project Explorer (second menuContribution) but item doesn't appears. I have read all infos on google but I have not found solution.
The problem persists even after the suppression of the VisibleWhen condition.
Below an extract of my plugin xml.
Can have any help?

...
<extension
         point="org.eclipse.ui.menus">
    <menuContribution
            locationURI="popup:org.eclipse.jdt.ui.PackageExplorer">
        <command
            commandId="myCommandId"
            icon="icons/wizard.gif"
            id="myId"
            label="My choice"
            style="push">
            <visibleWhen>
                <with
                     variable="activeMenuSelection">
                    <iterate>
                        <adapt
                           type="org.eclipse.jdt.core.IPackageFragment">
                        </adapt>
                    </iterate>
                </with>
            </visibleWhen>
        </command>
    </menuContribution>
    <menuContribution 
       locationURI="popup:org.eclipse.ui.navigator.ProjectExplorer#PopupMenu?after=additions">
        <command
            commandId="myCommandId"
            icon="icons/wizard.gif"
            id="myId"
            label="My choice"
            style="push">
            <visibleWhen>
                <with
                    variable="activeMenuSelection">
                    <iterate>
                        <adapt
                           type="org.eclipse.jdt.core.IPackageFragment">
                        </adapt>
                    </iterate>
                </with>
            </visibleWhen>
        </command>
    </menuContribution>
</extension>
...
Comment 1 Paul Webster CLA 2011-02-01 16:13:31 EST
Does it appear if used without the visibleWhen?

PW
Comment 2 michel Labarre CLA 2011-02-01 16:27:35 EST
No it does not appears
ML

(In reply to comment #1)
> Does it appear if used without the visibleWhen?
> 
> PW
Comment 3 michel Labarre CLA 2011-02-01 18:21:04 EST
Sorry, that's works
The id of the command was wrong (different from PackageExplorer!). The problem was that even after restart of the new version of eclipse plugin this one was not loaded.
Thank you and sorry again

(In reply to comment #2)
> No it does not appears
> ML
> 
> (In reply to comment #1)
> > Does it appear if used without the visibleWhen?
> > 
> > PW
Comment 4 Paul Webster CLA 2011-02-01 18:59:50 EST
(In reply to comment #3)
> Sorry, that's works

No problemmo.  Glad it's now working.
PW