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

Bug 319066

Summary: Error dialog appears when selecting New Signature on folder or project.
Product: z_Archived Reporter: ericfu.ca
Component: WTP IncubatorAssignee: Project Inbox <wtp.inc.xmlsecurity-inbox>
Status: RESOLVED FIXED QA Contact: David Williams <david_williams>
Severity: normal    
Priority: P3 CC: info
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description ericfu.ca CLA 2010-07-06 20:02:43 EDT
Build Identifier: 

XML Security from context menu should be disabled when no leaf XML file is selected.

Reproducible: Always

Steps to Reproduce:
1. Right click of a project or a folder under a project that contains XML file.
2. Select XML Security->New Signature
3. Exception will occur with error: org.eclipse.core.internal.resources.Project(Folder) cannot be cast to org.eclipse/core.resources.IFile
Comment 1 ericfu.ca CLA 2010-07-07 19:59:15 EDT
I can provide a patch of plugin.xml soon.
Comment 2 ericfu.ca CLA 2010-08-10 02:23:08 EDT
Due to company policy, I cannot provide the patch directly. But I will provide idea on how to do this. Basic idea is to made XML Security context menu only show up when a file is selected.

For popup menu contribution in plugin.xml, add an extra condition within <and>,
With variable "selection", count value should equals = "1", and file must be of instance IFile: <iterate> <instanceof value="org.eclipse.core.resources.IFile"/></iterate>

Dominik, please make this change.
Comment 3 Dominik Schadow CLA 2010-08-11 12:15:57 EDT
Fixed. XML Security context menu is now only available if one xml file is selected in one of the views.