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

Bug 358672

Summary: [Compatibility] Some of WTP Source Editing context menu contributions are misbehaving
Product: [Eclipse Project] Platform Reporter: Nick Sandonato <nsand.dev>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3 CC: remy.suen
Version: 4.2   
Target Milestone: 4.2 M5   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 334303    
Attachments:
Description Flags
Menu contributions patch v1 none

Description Nick Sandonato CLA 2011-09-22 17:48:23 EDT
The "Source" context menu item is missing from Structured Text Editors. It is appended to the ITextEditorActionConstants.GROUP_EDIT group from the editorContextMenuAboutToShow() method.

Additionally, the "Refactor" menu item is always visible regardless of if it has any actions. It displays the arrow as if it has a submenu, but once you mouse over it, the text is grayed out and it becomes disabled. Similar to the "Source" context menu, it is appended to ITextEditorActionConstants.GROUP_EDIT group from the editorContextMenuAboutToShow() method.
Comment 1 Remy Suen CLA 2011-09-23 07:48:06 EDT
Hi Nick, thanks for testing WTP on 4.x. Which build were you using?
Comment 2 Nick Sandonato CLA 2011-09-23 10:15:31 EDT
Hey, Remy. I was using Eclipse 4.2M2 I20110916-1615 and WTP 3.4 20110922105747.
Comment 3 Remy Suen CLA 2011-09-23 10:44:51 EDT
(In reply to comment #0)
> Additionally, the "Refactor" menu item is always visible regardless of if it
> has any actions. It displays the arrow as if it has a submenu, but once you
> mouse over it, the text is grayed out and it becomes disabled.

Without debugging the code, it's probably the same problem as bug 352380.
Comment 4 Remy Suen CLA 2011-09-26 13:02:01 EDT
(In reply to comment #0)
> The "Source" context menu item is missing from Structured Text Editors. It is
> appended to the ITextEditorActionConstants.GROUP_EDIT group from the
> editorContextMenuAboutToShow() method.

It seems this menu's children are not in the model so the menu contributions cannot find an insertion point as it can't find any separators with the desired id in the model.
Comment 5 Remy Suen CLA 2011-09-26 14:11:22 EDT
Created attachment 204031 [details]
Menu contributions patch v1

If we make the renderer recurse downwards to create opaque items for missing menu managers then the problem is solved.

Though it's not clear to me if these really have to be opaque or if they could instead be actual model elements.
Comment 6 Paul Webster CLA 2011-12-05 15:47:02 EST
(In reply to comment #5)
> Created attachment 204031 [details]
> Menu contributions patch v1
> 
I've released this for the next build.

PW
Comment 7 Remy Suen CLA 2012-01-11 11:15:52 EST
(In reply to comment #6)
> (In reply to comment #5)
> > Created attachment 204031 [details]
> > Menu contributions patch v1
> > 
> I've released this for the next build.

This looks okay on I20120110-2200.

Nick, the 'Source' submenu appears for me when I bring up the context menu on an XML file's 'Source' tab. Please let us know if you still have this problem.
Comment 8 Remy Suen CLA 2012-01-24 11:16:33 EST
Verified with I20120123-2200 on Windows 7.