Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327886 - Allow for multiple targetID to be specified under one poupmenu contribution
Summary: Allow for multiple targetID to be specified under one poupmenu contribution
Status: RESOLVED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 3.4.2   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 09:01 EDT by Andrew Flatt CLA
Modified: 2010-10-15 10:22 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Flatt CLA 2010-10-15 09:01:54 EDT
Build Identifier: 3.4.2.R342_v20090122

I currently have to duplicate xml to add a pop up menu to multiple areas in the IDE I would like to specify a menu item for each of the target id's below but to do this i need to create 4 viewer contributions with repeated xml in.  When you expand this to more menus the maintainance of them becomes an issue, where one change will need to be reflected in several places in the xml. 

"#TextEditorContext"  
"#CompilationUnitEditorContext"  
"#TextRulerContext" 
"#CompilationUnitRulerContext"


Reproducible: Always

Steps to Reproduce:
N/A
Comment 1 Paul Webster CLA 2010-10-15 10:22:11 EDT
We won't change the org.eclipse.ui.popupMenus extension.  That's already deprecated in 4.x, and has been "secondary" in 3.x since 3.3.

But just FYI, there's an #AbstractTextEditorContext that's common to both "#TextEditorContext" and "#CompilationUnitEditorContext".  Similar thing for #TextRulerContext.

In org.eclipse.ui.menus/menuContribution it is possible to do what you want, either by placing a submenu in all the locations you want, then the contents of the submenu are in one place only, or by placing your command contributions in the popup.any location (all popups) and then adding a visibleWhen that checked  org.eclipse.ui.ISources.ACTIVE_MENU_NAME contains the correct ID

PW