Bug 58179 - [misc] Problems with opening external files
Summary: [misc] Problems with opening external files
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.0   Edit
Hardware: PC Windows XP
: P2 major with 1 vote (vote)
Target Milestone: 3.2 M3   Edit
Assignee: Dani Megert CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 60012 74026 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-04-12 14:23 EDT by Dani Megert CLA
Modified: 2005-11-01 06:51 EST (History)
8 users (show)

See Also:


Attachments
proposed patch (3.39 KB, patch)
2004-07-22 20:32 EDT, Matt Liotta CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dani Megert CLA 2004-04-12 14:23:47 EDT
I20040407

Opening external files fails in cases where there's an non-text or non-Java
editor linked to it.

Example: open an external build.xml or plugin.xml file
Comment 1 Bob Foster CLA 2004-04-12 17:13:40 EDT
Please add to your use cases that Open External fails with all third-party
plugins, as well. This problem is not resolved by "fixing" all the plugins that
ship with Eclipse.

Note that many third-party plugins supply their own DocumentProviders. Requiring
a DocumentProvider that is incompatible with Eclipse resources may be necessary
to allow such files to be opened independent of IResource, but it is not a good
solution for plugins to Eclipse (the IDE).
Comment 2 Bob Foster CLA 2004-05-15 15:35:49 EDT
In I20040514, the open not only fails, it fails silently, i.e., no dialog, no
.log message.
Comment 3 Bob Foster CLA 2004-05-15 16:13:07 EDT
WRT last comment, I am seeing plenty of error reporting in the runtime-workspace.
Comment 4 Kai-Uwe Maetzel CLA 2004-06-25 11:02:59 EDT
Removing target milestone, no further action for 3.0.
Comment 5 Dani Megert CLA 2004-07-06 11:28:59 EDT
*** Bug 60012 has been marked as a duplicate of this bug. ***
Comment 6 Dani Megert CLA 2004-07-19 11:22:58 EDT
*** Bug 70347 has been marked as a duplicate of this bug. ***
Comment 7 Matt Liotta CLA 2004-07-22 20:32:41 EDT
Created attachment 13555 [details]
proposed patch

This patch changes the generated Java source, so that future plugin developers
won't encounter this bug.

I looked into making a patch that would enable previously generated plugin's to
work, but it looked like too much of a hack. Granted calling an internal class
like this patch does is not good either.
Comment 8 Dani Megert CLA 2004-07-23 05:09:03 EDT
The bug is about general problems with Open External File... and not specific to
PDE UI against which your patch is.
Comment 9 Matt Liotta CLA 2004-07-23 10:57:42 EDT
My mistake, but it still seems like a useful patch for the PDE UI.
Comment 10 Dani Megert CLA 2004-07-23 11:05:29 EDT
I did not comment on that ;-) File a new bug with the patch against PDE UI.
Comment 11 Dani Megert CLA 2004-09-16 08:12:44 EDT
*** Bug 74026 has been marked as a duplicate of this bug. ***
Comment 12 Dani Megert CLA 2004-09-20 08:58:42 EDT
see also bug 74194
Comment 13 NH Hockey Player CLA 2004-11-01 10:25:24 EST
Can someone fix this please. It halts all development. I cannot get this IDE 
to operate anything between 3.0.1 and beyond
Comment 14 C. Lamont Gilbert CLA 2004-11-19 00:54:01 EST
My concern was probably closer to bug 70347 but it was marked as duplicate, so
im posting here.


I am having trouble as well.  What am I supposed to do?  The class
org.eclipse.ui.internal.editors.text.JavaFileEditorInput is not accessible by
me, but its being passed into my Editor.  I can't do anything with this!

Plus, I tried to see if it would give me a File throught the iadaptable
interface, but no such luck.

What am I supposed to do with this JavaFileEditorInput???
Comment 15 Dani Megert CLA 2004-11-19 05:18:08 EST
>What am I supposed to do with this JavaFileEditorInput???
see ILocationProvider.getPath(Object)
Comment 16 C. Lamont Gilbert CLA 2004-11-19 08:03:22 EST
>see ILocationProvider.getPath(Object)

I could say the exact same thing about that interface.  Though I can import it,
I certainly have no instances of it, nor do I know any way to get any instances
of it.

All Eclipse passes is 'IEditorInput'.

I just don't understand.  Eclipse has no problem opening a file and calling my
plugin based on the file extension.  In-workbench and out-of-workbench files are
both opened and passed to my plugin's Editor of that filetype.  But while the
in-workbench ones are properly put into IFileEditorInputs, external files end up
in some unaccessible instance of JavaFileEditorInput.  So all I see is
IEditorInput which has no useable methods, and all I can do is guess about what
it can be adapted to. (again because I have no access to JavaFileEditorInput,
nor any documentation) It just don't make sense.

One should pass IFile, the other should pass File.

Is there some part of the architecture that I missed?  some extension perhaps?
Comment 17 C. Lamont Gilbert CLA 2004-11-19 10:21:53 EST
OK, after finding the JavaFileEditorInput in CVS, I was able to figure out the
workaround you were implying with

ILocationProvider.getPath(Object)

Its working, though after reading bug 74263, I understand this won't work
cleanly.  But its good enough to keep me going, thanks!
Comment 18 Dani Megert CLA 2004-11-23 02:59:06 EST
see also bug 74194.
Comment 19 Dani Megert CLA 2005-09-22 10:30:59 EDT
This now works for editors that support IPathEditorInput and problems will no
longer just be logged but the user will get feedback.

Tested with several editors like PDE, Ant, embedded MS Word and external
application.
Comment 20 Dirk Baeumer CLA 2005-11-01 06:23:02 EST
start verifying
Comment 21 Dirk Baeumer CLA 2005-11-01 06:51:52 EST
Test opening an external plugin.xml file and it correctly opened the plugin
manifest editor.