| Summary: | Support to open files in eclipse editor (StorageEditorInput LocalFileStorage) | ||
|---|---|---|---|
| Product: | [Eclipse Project] Platform | Reporter: | John J. Barton <johnjbarton> |
| Component: | Runtime | Assignee: | platform-runtime-inbox <platform-runtime-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | ||
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
In searching through the maze that is eclipse api, I could not find a seemingly trivial function: open a file in an editor. Eventually I read through the eclipse source and found that even the debugger has its own internal classes to implement this function. Surely there must be a public part of the API that is equivalent to LocalFileStorage and StorageEditorInput from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java?? 1) If there is such a public API, then this bug report says: ProcessConsole should use the public API. 2) Else, there should be a public API. In my case I had to write: IFile ifile = root.getFileForLocation(path); if (ifile == null) { // The file is not in the workspace File file = new File(fFilePath); org.eclipse.debug.core.sourcelookup.containers.LocalFileStorage lfs = new LocalFileStorage(file); input = new StorageEditorInput(lfs, file); } else { input = new FileEditorInput(ifile); } And copy the source of StorageEditorInput into my code.