This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 228786 - [Contributions] Unable to invoke contributed popup menu items - exception in log
Summary: [Contributions] Unable to invoke contributed popup menu items - exception in log
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 blocker (vote)
Target Milestone: 3.4 M7   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 229754 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-04-24 18:19 EDT by Amy Wu CLA
Modified: 2008-05-02 11:39 EDT (History)
4 users (show)

See Also:


Attachments
contextmenu.log (3.42 KB, application/octet-stream)
2008-04-24 18:19 EDT, Amy Wu CLA
no flags Details
Popup Menus v01 (1.71 KB, patch)
2008-04-25 13:20 EDT, Paul Webster CLA
no flags Details | Diff
I0422-0800 workbench with patch applied (3.71 MB, application/octet-stream)
2008-04-25 14:27 EDT, Paul Webster CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amy Wu CLA 2008-04-24 18:19:24 EDT
Created attachment 97539 [details]
contextmenu.log

Using eclipse-SDK-I20080422-0800-win32

1. Add the following to a plugin.xml
<extension point="org.eclipse.ui.menus">
<menuContribution
  locationURI="popup:#TextEditorContext?before=additions">
  <menu
    id="mySubMenu"
    label="MySubMenu">
    <command
      commandId="org.eclipse.ui.help.aboutAction"
      style="push">
    </command>
  </menu>
</menuContribution>
<menuContribution
locationURI="popup:org.eclipse.jdt.ui.PackageExplorer?before=additions">
  <menu
    id="mySubMenu"
    label="MySubMenu">
    <command
      commandId="org.eclipse.ui.help.aboutAction"
      style="push">
    </command>
  </menu>
</menuContribution>
</extension>

2. Try to invoke the MySubMenu->About action in the Text Editor popup menu or Package Explorer popup menu

3. The menu item does not work and you get the attached exception in the log.


This worked fine in Eclipse 3.4M6a.  I think it might have to do with the fix for bug 224682.  It looks like dispose is being called on the contribution items but then the menu manager will attempt to use the disposed contribution items.
Comment 1 Amy Wu CLA 2008-04-24 18:49:35 EDT
Actually, I'm going to go ahead and mark this as a blocker since this bug means none of my popup menu items work.
Comment 2 Paul Webster CLA 2008-04-25 13:20:43 EDT
Created attachment 97645 [details]
Popup Menus v01

Don't dispose the contribution items in the SWT.Hide event, since it fires the SWT.Selection event afterwards.

PW
Comment 3 David Williams CLA 2008-04-25 13:32:22 EDT
Thanks Paul ... would it be easy for you to attach a jar, for org.eclipse.ui.workbench, with this fix that "matches" the I20080422-0800 build? 
That way we in WTP could apply it to verify and continue our testing? 

Thanks, 
Comment 4 Paul Webster CLA 2008-04-25 13:57:37 EDT
Released to HEAD >20080425

David, I'll see about spinning the jar

PW
Comment 5 Paul Webster CLA 2008-04-25 14:27:31 EDT
Created attachment 97661 [details]
I0422-0800 workbench with patch applied
Comment 6 Amy Wu CLA 2008-04-25 15:37:15 EDT
Verified that replacing my workbench jar with the one attached fixes the problem.
Comment 7 Nick Sandonato CLA 2008-05-02 09:42:54 EDT
*** Bug 229754 has been marked as a duplicate of this bug. ***
Comment 8 Miles Parker CLA 2008-05-02 11:39:04 EDT
Thanks, this fixes my issue as well. [Mac OS X]