Bug 138137 - [DnD] Drag-and-drop of source files into editor
Summary: [DnD] Drag-and-drop of source files into editor
Status: RESOLVED DUPLICATE of bug 13221
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1.2   Edit
Hardware: PC Windows XP
: P3 enhancement with 1 vote (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
: 146630 146860 154686 (view as bug list)
Depends on: 111887
Blocks:
  Show dependency tree
 
Reported: 2006-04-23 10:02 EDT by Alain Clermont CLA
Modified: 2007-02-09 03:23 EST (History)
11 users (show)

See Also:


Attachments
Patch to add Drag and Drop of external files (19.26 KB, patch)
2006-06-20 15:52 EDT, Eric Moffatt CLA
no flags Details | Diff
Patch to add Drag and Drop of external files (19.26 KB, patch)
2006-06-20 16:03 EDT, Eric Moffatt CLA
no flags Details | Diff
Patch with my changes applied (18.23 KB, patch)
2006-06-28 09:53 EDT, Dani Megert CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Clermont CLA 2006-04-23 10:02:17 EDT
Being able to drag-and-drop a source file from another Windows app into the editor would be a definite improvement to Eclipse source code editor.
Such feature is commonly available among source code editors.
Comment 1 Paul Webster CLA 2006-06-14 09:23:26 EDT
*** Bug 146860 has been marked as a duplicate of this bug. ***
Comment 2 Eric Moffatt CLA 2006-06-17 20:07:59 EDT
*** Bug 146630 has been marked as a duplicate of this bug. ***
Comment 3 Eric Moffatt CLA 2006-06-20 15:52:28 EDT
Created attachment 44946 [details]
Patch to add Drag and Drop of external files


This patch also includes a first-cut at moving the current 'Open File' logic out of the texteditor package and into the IDE.
Comment 4 Eric Moffatt CLA 2006-06-20 16:03:17 EDT
Created attachment 44947 [details]
Patch to add Drag and Drop of external files


This patch also includes a first-cut at moving the current 'Open File' logic out of the texteditor package and into the IDE.
Comment 5 Eric Moffatt CLA 2006-06-26 14:39:42 EDT
Tod / Daniel, can you check out the patch and see if it's on the right track...? Note that it will introduce a compile error into org.eclipse.ui.examples.readmetool that I'm not sure how to handle (re-export the new dependencies from the IDE ?) so you might check out that project before applying the patch.

Thanks folks...

Comment 6 Dani Megert CLA 2006-06-27 12:33:12 EDT
The compiler errors that get introduced are caused by bug 148844 in the compiler. For now the change is binary compatible but not source compatible until said bug gets fixed.

Here some other things that I saw at a first quick glance:
- I would use IFileStoreStorage instead of IFileStoreFileStorage
- writing to console should be removed before committing the patch

More to comments tomorrow.
Comment 7 Dani Megert CLA 2006-06-28 07:20:18 EDT
>I would use IFileStoreStorage instead of IFileStoreFileStorage
I just noticed that this isn't an interface. We should do it like with the FileEditorInput which implements IFileEditorInput: simply call it FileStoreStorage and call the editor input FileStoreEditorInput.
Comment 8 Eric Moffatt CLA 2006-06-28 09:23:31 EDT
Thanks Daniel, good feedback. Tod and I are going to see if we can come up with some approach to the dependency propagation since it seems to be a general problem that has come up before during this type of API enhancement.
Comment 9 Dani Megert CLA 2006-06-28 09:27:22 EDT
>"org.eclipse.ui.DefaultTextEditor"; //HACK!! EditorsUI.DEFAULT_TEXT_EDITOR_ID; //$NON-NLS-1$

This hack can be replace by: IDEWorkbenchPlugin.DEFAULT_TEXT_EDITOR_ID
Comment 10 Dani Megert CLA 2006-06-28 09:34:50 EDT
Wait: even better: the code you copied from the OpenExternalFileAction is quite outdated. You can use IDE.getEditorDescriptor(String) which allows you to get rid of the content type description and also of the reference to the text editor (see also bug 148993).
Comment 11 Dani Megert CLA 2006-06-28 09:53:28 EDT
Created attachment 45464 [details]
Patch with my changes applied
Comment 12 Dani Megert CLA 2006-06-28 09:55:20 EDT
In addition I would add (or replace it by) the more flexible version of openEditor(...) which takes the following parameter(s):

     * @param activate
     * 			  if <code>true</code> the editor will be activated

and eventually:

     * @param determineContentType
     * 			  attempt to resolve the content type for this file


Comment 13 John Arthorne CLA 2006-06-30 14:02:19 EDT
Eric: I can't remember if I ever got back to you on this... essentially the compile error is fine, it's not a binary compatibility problem for plugins compiled against an older version.  No need to re-export org.eclipse.core.filesystem.  A similar problem came up in 3.2 with CopyFilesAndFoldersOperation.  However, another option is to use URI in the API method instead (IDE.openEditor(URI)), and then use IFileStore under the covers... that's the approach I took in the org.eclipse.core.resources plugin.
Comment 14 Tod Creasey CLA 2006-10-11 10:44:38 EDT
Note that the changes to Bug 111887 will require a slight rework of the drag and drop portion of this patch
Comment 15 Eric Moffatt CLA 2006-10-16 10:47:14 EDT
*** Bug 154686 has been marked as a duplicate of this bug. ***
Comment 16 Eric Moffatt CLA 2006-10-16 10:49:26 EDT
Updateing the target milestone so it doesn't fall off my radar...
Comment 17 Eric Moffatt CLA 2006-12-08 14:29:12 EST
Deferring in favor of getting the Commands story done...

Folks, this part of my cache has been over-written...what is the current state of this defect ?
Comment 18 Dani Megert CLA 2007-01-08 07:02:56 EST
Note that this is basically a dup of bug 13221.
Comment 19 Eric Moffatt CLA 2007-02-06 14:36:05 EST
Deferring until M6. Still need to determine what the 'slight rework' means...
Comment 20 Dani Megert CLA 2007-02-09 03:23:10 EST

*** This bug has been marked as a duplicate of bug 13221 ***