Bug 2869 - [Editor Mgmt] EC: Editing a file outside the workspace (1GK7OZS)
Summary: [Editor Mgmt] EC: Editing a file outside the workspace (1GK7OZS)
Status: RESOLVED DUPLICATE of bug 37935
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 2.0   Edit
Hardware: All Windows 98
: P2 enhancement with 2 votes (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: investigate
Depends on:
Blocks:
 
Reported: 2001-10-10 22:45 EDT by Simon Arsenault CLA
Modified: 2003-07-24 10:37 EDT (History)
5 users (show)

See Also:


Attachments
ExternalEditorInput class that can be fed to an editor to allow it to edit external files. (2.40 KB, text/plain)
2003-02-15 16:00 EST, Ed Burnette CLA
no flags Details
FileStorage class to represent a file not in the workspace, can be passed to ExternalEditorInput. (2.29 KB, text/plain)
2003-02-15 16:04 EST, Ed Burnette CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Simon Arsenault CLA 2001-10-10 22:45:05 EDT
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:
Comment 1 Kevin Haaland CLA 2002-04-23 23:17:20 EDT
Consider as a post 2.0 enhancement
Comment 2 Randy Giffen CLA 2002-08-08 16:05:56 EDT
Reopen for investigation
Comment 3 DJ Houghton CLA 2002-10-16 14:04:40 EDT
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?
Comment 4 Kevin Haaland CLA 2002-10-21 15:30:41 EDT
This is a useful feature. Increasing priority. 
Comment 5 Nick Edgar CLA 2002-11-05 16:33:36 EST
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).
Comment 6 Ed Burnette CLA 2003-02-15 15:59:13 EST
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.
Comment 7 Ed Burnette CLA 2003-02-15 16:00:55 EST
Created attachment 3517 [details]
ExternalEditorInput class that can be fed to an editor to allow it to edit external files.
Comment 8 Ed Burnette CLA 2003-02-15 16:04:55 EST
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());
Comment 9 Ed Burnette CLA 2003-07-24 10:18:13 EDT
Should this be marked as a dup of bug 37935 (or vice versa)?
Comment 10 Simon Arsenault CLA 2003-07-24 10:37:31 EDT

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