Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 323305 - [Codegen] Load resources by dropping Files or IResources on the editor
Summary: [Codegen] Load resources by dropping Files or IResources on the editor
Status: CLOSED FIXED
Alias: None
Product: EMF
Classification: Modeling
Component: Core (show other bugs)
Version: 2.7.0   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Ed Merks CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-21 06:18 EDT by Eike Stepper CLA
Modified: 2013-07-10 11:26 EDT (History)
3 users (show)

See Also:


Attachments
Patch for Editor.javajet (3.30 KB, patch)
2010-08-21 06:18 EDT, Eike Stepper CLA
no flags Details | Diff
Patch for Editor.javajet (2.10 KB, patch)
2010-08-21 06:24 EDT, Eike Stepper CLA
no flags Details | Diff

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