Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335612 - Cannot DnD build file with .ent, .ant, or .macrodef in Ant view
Summary: Cannot DnD build file with .ent, .ant, or .macrodef in Ant view
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M6   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-27 15:41 EST by Michael Rennie CLA
Modified: 2011-01-31 16:01 EST (History)
0 users

See Also:


Attachments
fix (7.37 KB, patch)
2011-01-27 15:59 EST, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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