Summary: | Drag & Drop file to Editor launchs file in system editor | ||||||
---|---|---|---|---|---|---|---|
Product: | [Tools] Target Management | Reporter: | Kevin Doyle <kjdoyle> | ||||
Component: | RSE | Assignee: | Kevin Doyle <kjdoyle> | ||||
Status: | CLOSED FIXED | QA Contact: | Martin Oberhuber <mober.at+eclipse> | ||||
Severity: | normal | ||||||
Priority: | P3 | CC: | dmcknigh, xuanchen | ||||
Version: | 2.0 | Keywords: | contributed | ||||
Target Milestone: | 2.0.1 | ||||||
Hardware: | PC | ||||||
OS: | Windows XP | ||||||
Whiteboard: | |||||||
Bug Depends on: | 197326 | ||||||
Bug Blocks: | |||||||
Attachments: |
|
Description
Kevin Doyle
2007-05-17 09:45:38 EDT
I agree that dragging the file to the editor area should always open an editor in Eclipse and never outside Eclipse. Kushal I think you've worked on something like this before, what do you think? Please reassign if you do not have time addressing this for 2.0. This is sort of fixed with the patch attached to bug 189268 except that drag and drop .html, .htm, .shtml to the editor does nothing now. So it seems like it tries to launch the System Editor for .html etc but cannot do this because the System Editor supports FileTransfer only which we no longer do. For me, this means that the original bug (opening in the SystemEditor when it should use the Text Editor) is not fixed. Kevin if I'm not mistaken you've been dealing with Editable support, could you have a look? The reason this happens for any file associated with the Web Browser is because the IEditorDescriptor for the Web Browser has a property for "launcher". Inside EditorAreaDropAdapter.openNonExternalEditor(IWorkbenchPage, IEditorInput, String) it does this: IEditorDescriptor editorDesc = editorReg.findEditor(editorId); if (editorDesc != null && !editorDesc.isOpenExternal()) { result = page.openEditor(editorInput, editorId); } else { result = null; } editorDesc.isOpenExternal() returns true because a "launcher" property is set for the Web Browser's editor descriptor. If you compare the behavior to the Java Perspective it will work the same way RSE does for all files except those associated with the web browser. Since it uses a different file transfer method it uses a different openNonExternalEditor method. openNonExternalEditor(IWorkbenchPage page, IFile file) In this method if isOpenExternal() is true it follows the else code which will open the file in the default editor. Created attachment 74837 [details] Added a check if editor would open external and if so used default editor Created a workaround such that if the file would open in an external editor with the preferred editor that we make the preferred editor the default editor. This is needed till bug #197326 is fixed, which is currently assigned 3.4. Legal Message: I, Kevin Doyle, declare that I developed attached code from scratch, without referencing any 3rd party materials except material licensed under the EPL. I am authorized by my employer, IBM Canada Ltd. to make this contribution under the EPL. The patch is good for the current workaround of the platform bug #197326. I will commit the patch. I committed the patch. Verified fixed with I20070823-0800. |