Bug 526774 - "New XML file" wizard doesn't show up for current selection adaptable to IFile
Summary: "New XML file" wizard doesn't show up for current selection adaptable to IFile
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.21   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-11-02 11:40 EDT by Nicolas Duboc CLA
Modified: 2021-01-05 02:58 EST (History)
0 users

See Also:


Attachments
Patch for more adaptative handler for menu action "New XML File..." (1.54 KB, text/plain)
2017-11-02 11:40 EDT, Nicolas Duboc CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Duboc CLA 2017-11-02 11:40:37 EDT
Created attachment 271301 [details]
Patch for more adaptative handler for menu action "New XML File..."

In some conditions, selecting the "Generate > New XML File..." context menu action on an XSD file doesn't have any effect.  The "New XML File" doesn't show up.

The handler for the "Generate > New XML File..." action in context menu is too
strict on the expected type of the current selection.  If the object of the current selection is not an instance of the IFile class, the action is silently cancelled.

It simply checks if the current selection is an IFile, instead of checking if the
current selection is adaptable to an IFile, like prescribed by the Eclipse plug-in development practice.
This prevents the "New XML File.." wizard to open when the selection is actually a proxy to an IFile (like some kinds of product-specific explorers do).

Attaching a patch which fixes the issue (based on current master of webtools.sourceediting commit a1aa106c284a915749f57).
Comment 1 Nitin Dahyabhai CLA 2017-11-08 14:36:09 EST
Nicolas, please sign your ECA.
Comment 2 Nicolas Duboc CLA 2017-11-17 02:32:43 EST
(In reply to Nitin Dahyabhai from comment #1)
> Nicolas, please sign your ECA.

It's done now.
Comment 3 Nitin Dahyabhai CLA 2021-01-05 02:58:42 EST
Fixed with newer Adapters utility.