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

Bug 323305

Summary: [Codegen] Load resources by dropping Files or IResources on the editor
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: martin.fluegge, stefan.bosshard.4, vroldanbet
Version: 2.7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch for Editor.javajet
none
Patch for Editor.javajet none

Description Eike Stepper CLA 2010-08-21 06:18:10 EDT
Created attachment 177155 [details]
Patch for Editor.javajet

I find it quite annoying to go through the "Load Resources..." dialog each time, while already seeing the resources in the Resource Navigator or the Windows Explorer. I propose to change the Editor.javajet template to react to drop events of the types String[] for external files and IResource[] for workspace files.

I'm not a DND expert but the attached patch seems to work fine for me...
Comment 1 Eike Stepper CLA 2010-08-21 06:24:53 EDT
Created attachment 177156 [details]
Patch for Editor.javajet
Comment 2 Eike Stepper CLA 2010-09-09 06:55:02 EDT
My patch misses the declaration of some additional import statements that are needed (e.g. java.io.File)!
Comment 3 Ed Merks CLA 2012-10-18 12:01:56 EDT
The framework itself is enhanced to support LocalSelectionTransfer and FileTransfer. File names and IResources are converted to URIs and are passed to the command framework as normal.  The command framework is enhanced to provide specialized support for dragging and dropping of URIs such that, by default, they delegate to the resource set's item provider which loads those as resources into the resource set.

The changes are committed to master for 2.9

http://git.eclipse.org/c/emf/org.eclipse.emf.git/commit/?id=3a0e4ec101b59d0c6799ceeaee8d9360d478935f
Comment 4 Ed Merks CLA 2013-07-10 11:26:50 EDT
The changes are available in Kepler.