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

Bug 308562

Summary: [explorer] DTD, XML, and XML Schema "new" context menu items should be grouped together
Product: [WebTools] WTP Source Editing Reporter: Justin Berstler <bjustin>
Component: wst.xmlAssignee: Nitin Dahyabhai <thatnitind>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: david_williams, gindik, thatnitind, valentinbaciu
Version: 3.2Flags: david_williams: pmc_approved+
thatnitind: pmc_approved? (raghunathan.srinivasan)
thatnitind: pmc_approved? (naci.dai)
thatnitind: pmc_approved? (deboer)
thatnitind: pmc_approved? (neil.hauge)
thatnitind: pmc_approved? (kaloyan)
Target Milestone: 3.2 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard: PMC_approved
Bug Depends on: 308557, 308558, 308559    
Bug Blocks:    
Attachments:
Description Flags
complete patch for DTD, XML, XSD, and XSL
none
before image
none
after image none

Description Justin Berstler CLA 2010-04-08 16:41:50 EDT
Build Identifier: 20100315195309

Right now, the common navigator extensions which contribute these actions do not specify any menuGroupId, which causes these items to appear in the context menu haphazardly grouped in with any other context menu item that doesn't specify a menuGroupId.

Because these items are logically related, I suggest not only specifying a menuGroupId, but specifying the same menuGroupId for all three of these contributions.  This will not only result in these items always being grouped together in the context menu, but also having the group distinctly separated from any other items.

I have already opened separate bugs for each of the DTD, XML, and XSD components in WTP Source Editing, but for tracking purposes, I would like to use this as a "parent" bug which ties them all together.

Reproducible: Always

Steps to Reproduce:
1. create a simple project
2. open Project Explorer, right click the project root
3. observe that the New > DTD, XML, and XML Schema items are lumped in with File, Folder and any other common navigator action contribs that do not specify a menuGroupId.
Comment 1 Justin Berstler CLA 2010-04-08 16:53:51 EDT
In the child bugs, I attached patches which suggest a menuGroupId value of "org.eclipse.wst.xml.new.menuGroup".  While the actual value is not of incredible importance to me, all three contributions will need to use the same value in order for them to be grouped together.
Comment 2 Nitin Dahyabhai CLA 2010-04-08 17:23:12 EDT
Requesting PMC approval...just in case.  I suspect we'll have to create a bug for XSL as well.
Comment 3 Valentin Baciu CLA 2010-04-16 16:00:00 EDT
I was wondering if it is not safer to constrain these contributions to the XML perspective?

<with variable="activeWorkbenchWindow.activePerspective">
   <equals value="org.eclipse.wst.xml.ui.perspective"/>
</with>

Otherwise, the XML shortcuts will show up in all perspectives. I know XML resources are commonly used in many development scenarios, so perhaps this was the original intent?
Comment 4 Nitin Dahyabhai CLA 2010-04-19 10:25:45 EDT
(In reply to comment #3)
Sounds correct to me.  Justin?
Comment 5 Justin Berstler CLA 2010-04-19 11:22:42 EDT
(In reply to comment #4)
> (In reply to comment #3)
> Sounds correct to me.  Justin?

While I cannot confirm or deny that this is an appropriate way to scope these actions to a given perspective, I would definitely prefer having these actions scoped to the XML perspective.  

In general, this would allow applications that build on top of WTP to selectively add these actions to contexts (possibly defined downstream) where they also make sense - as opposed to trying to remove them from contexts where these actions do not make sense.

That being said, I still think these actions should be explicitly grouped together rather than just being thrown in with any actions which do not specify a menuGroupId.
Comment 6 David Williams CLA 2010-04-27 10:44:50 EDT
Can you sum this up and net this out for PMC review? What's being changed? Is it complete, or is there follow on work to do?
Comment 7 Nitin Dahyabhai CLA 2010-04-28 06:50:39 EDT
Created attachment 166303 [details]
complete patch for DTD, XML, XSD, and XSL

This is a patch for the 4 main XML plug-ins.  It neither adds nor removes actions or features and it doesn't change any strings.  What it does do is group the New wizards for the 4 file types together on the common navigator's context menu, so that instead of them mingling with other file types alphabetically, they're contained within their own section, as well as defaulting to being on the context menu only in the XML Perspective.
Comment 8 Nitin Dahyabhai CLA 2010-04-28 06:51:11 EDT
Created attachment 166304 [details]
before image
Comment 9 Nitin Dahyabhai CLA 2010-04-28 06:51:34 EDT
Created attachment 166305 [details]
after image
Comment 10 Nitin Dahyabhai CLA 2010-04-28 06:54:51 EDT
(In reply to comment #6)
> Can you sum this up and net this out for PMC review? What's being changed? Is
> it complete, or is there follow on work to do?

Attachment 166303 [details] is the entire proposed change.
Comment 11 David Williams CLA 2010-04-28 08:35:20 EDT
Looks good. Thanks.
Comment 12 Nitin Dahyabhai CLA 2010-05-04 15:32:58 EDT
Was released.