Bug 97704 - [Contributions] Sub-menu ALWAYS appears on MY context menus
Summary: [Contributions] Sub-menu ALWAYS appears on MY context menus
Status: RESOLVED INVALID
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: JDT-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2005-05-31 16:11 EDT by Sapna George CLA
Modified: 2007-06-22 10:04 EDT (History)
1 user (show)

See Also:


Attachments
Screen shot of the JDT pop-up sub menu that is completely out of place in my editor (40.58 KB, image/jpeg)
2005-05-31 16:19 EDT, Sapna George CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sapna George CLA 2005-05-31 16:11:43 EDT
I'm developing a GEF-based graphical editor. Eclipse 3.1M6 and M7 does a wierd 
thing to my context popup menus. I'm always getting a JDT sub-menu with the 
groups 'Run As', 'Debug As', 'Team', 'Compare With' and 'Replace With' in my 
popup menus. When i checked org.eclipse.jdt.ui_3.1.0's plugin.xml, i saw that 
these are added to the "additions" menu path. 

I tried different perspectives, and it appears in all. It also appears no 
matter what kind of project i create my diagram file under (need not be a Java 
Project). 

I don't want these on my editor's context popup menus beacuse they are 
completely out of context. The components on my diagram cannot be executed 
using Run As or Debug As. So, it's very misleading and confusing to the users.
Comment 1 Sapna George CLA 2005-05-31 16:19:34 EDT
Created attachment 22098 [details]
Screen shot of the JDT pop-up sub menu that is completely out of place in my editor

The screen shot shows a diagram editor with a palette on the right side. It
shows a box figure representing a diagram component. Right clicking on this box
figure presents the pop-up menu where the JDT sub-menu appears (circled in
Red). However, this box component cannot and should not be 'Run'. So, the
sub-menu is very misleading to the users.
Comment 2 Dirk Baeumer CLA 2005-05-31 16:59:01 EDT
Moving to Platform/UI for comments how to disable this for editors. Note that
these are the actions we pushed for to be present in the Java editor. However,
AFAIK they are not contributed in JDT/UI. 
Comment 3 Douglas Pollock CLA 2005-06-01 10:20:35 EDT
Please see Bug 68938.
Comment 4 Dirk Baeumer CLA 2005-06-01 11:58:50 EDT
Douglas, does this mean if the client doesn't register the context menu the
entries will not show up ?
Comment 5 Douglas Pollock CLA 2005-06-01 15:03:21 EDT
You have the option of: registering the context menu and receiving object
contributions based on the active part's editor input; registering the context
menu and receiving no such object contributions; or not registering the context
menu at all (receiving no object contributions of any kind).
Comment 6 Dirk Baeumer CLA 2005-06-01 17:14:55 EDT
Thanks Doug !
Comment 7 Dirk Baeumer CLA 2005-06-01 17:15:54 EDT
Dani, does the editor framework register the context menu or is this up to the
individual editor implementor ?
Comment 8 Dani Megert CLA 2005-06-01 17:28:18 EDT
From what part does your editor inherit?
Comment 9 Dani Megert CLA 2005-06-01 17:33:01 EDT
Please include the full hierarchy chain. Thanks.

Setting to REMIND until it's clear that the text editor is subclassed.
Comment 10 Sapna George CLA 2005-06-02 14:05:09 EDT
Using Doug's new API, i registered my context menu in my editor as: 

((IEditorSite)getSite()).registerContextMenu(id, menuManager, 
selectionProvider, false);

The false flag eliminates common editor sub-menus, such as the ones i 
complained about, from my context menus. 

So, i guess my problem is solved. thanks
Comment 11 Dani Megert CLA 2005-06-02 15:41:37 EDT
.
Comment 12 Dani Megert CLA 2007-06-22 09:59:23 EDT
Get rid of deprecated state.
Comment 13 Dani Megert CLA 2007-06-22 10:04:37 EDT
.