Community
Participate
Working Groups
From the eclipse newsgroup From: kmunir@ca.ibm.com (Kushal Munir) Newsgroups: eclipse.tools Subject: Opening a file in an editor Date: 10 Sep 2001 19:30:10 GMT Hi, I posted a related message about this before, but I'm wondering why Eclipse does not provide a way to open any file in an editor. It seems I need the file to be inside my workspace (which means it has to belong to a project), but there are situations when I do not want this (i.e. do not want it to be visible to the user through the navigator view). For example, I may have the file in a temporary location that I do not want to expose to the user. For situations such as this, what can I do? IStorageEditorInput seems to be read-only input, so that does not help. I'd appreciate any help. Thanks NOTES:
Consider as a post 2.0 enhancement
Reopen for investigation
What's the status of this bug report? It is in the list of high-priorities to address in Eclipse 2.1 but the priority is set to P5. Has a dynamic team been created to address this problem?
This is a useful feature. Increasing priority.
This will have to be addressed after M3, for M4. Moving to Text to comment on what changes would be needed there. The current editor inputs and document providers make strong assumptions that the document comes from either an IStorage (read-only, but from anywhere) or an IResource (read-write, but confined to workspace).
I would like to attach a couple of classes that can help support editing external files outside the workspace. These were adapted from the CDT project but I think they belong in the platform.
Created attachment 3517 [details] ExternalEditorInput class that can be fed to an editor to allow it to edit external files.
Created attachment 3518 [details] FileStorage class to represent a file not in the workspace, can be passed to ExternalEditorInput. Example usage: IStorage storage = new FileStorage(path); IEditorRegistry registry= PlatformUI.getWorkbench().getEditorRegistry(); IEditorDescriptor desc = registry.getDefaultEditor(fileName); if (desc == null) { desc = registry.getDefaultEditor(); } IEditorInput input = new ExternalEditorInput(storage); IEditorPart editor = page.openEditor(input, desc.getId());
Should this be marked as a dup of bug 37935 (or vice versa)?
*** This bug has been marked as a duplicate of 37935 ***