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

Bug 335612

Summary: Cannot DnD build file with .ent, .ant, or .macrodef in Ant view
Product: [Eclipse Project] Platform Reporter: Michael Rennie <Michael_Rennie>
Component: AntAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 3.7   
Target Milestone: 3.7 M6   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
fix none

Description Michael Rennie CLA 2011-01-27 15:41:13 EST
I20110126-1800

Steps:
1. Create an Ant build file using one of the alternate supported extensions (.ent, .ant, .macrodef)
2. try to drag & drop it into the Ant view.

Expected
It would show up in the Ant view

Happens
Nothing, the drop is ignored. The only files that can be DnD'd are 'build.xml' and '*.xml'.

The code in AntViewDropAdapter#acceptBuildFile(..) is the culprit:

return name.toLowerCase().endsWith(".xml") || AntUtil.isKnownBuildfileName(name);

We should be using the util method to know if the file is a supported content type, not if it has a specific extension or name; since a build file can have any name and there is more than one kind of supported extension.
Comment 1 Michael Rennie CLA 2011-01-27 15:59:48 EST
Created attachment 187777 [details]
fix

fixes the DnD issue by checking if the drop candidate is a known Ant content type
Comment 2 Michael Rennie CLA 2011-01-31 16:01:55 EST
applied to HEAD