Opening a plain file in filesystem in org.eclipse.ui.DefaultTextEdtior [message #499129] |
Thu, 19 November 2009 19:57  |
Eclipse User |
|
|
|
Hi,
I feel rather stupid, but I'm completely unable to find a solution.
I am writing an application based on RCP.
At a certain point I need to open a text file in my local filesystem and let the user edit it. When the file is closed i resume processing.
I have my Perspective and several Views docked around the EditorArea.
I am able to compute the full path of the file that should be opened.
I am unable to open a stupid editor.
The latest of a zillion tries I did (found somewhere on the internet) reads:
String path = "C:\\TEMP\\file.txt";
IFileStore fileOnLocalDisk = EFS.getLocalFileSystem().getStore(path);
FileStoreEditorInput editorInput = new FileStoreEditorInput(fileOnLocalDisk);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
page.openEditor(editorInput, "org.eclipse.ui.DefaultTextEdtior");
This does not compile because:
- EFS cannot be resolved
- IFileStore cannot be resolved to a type
- FileStoreEditorInput cannot be resolved to a type
Several similar attempts failed with similar errors. I seem unable to find anything under Package org.eclipse.core.filesystem and similia.
Tomorrow morning I will completely reinstall eclipse 3.5 in order to be sure I didn't do something stupid adding components and upgrading.
I simply cannot believe opening a text file in the default text editor is't a trivial task.
What am I doing wrong?
Please help me.
Mauro
|
|
|
|
Powered by
FUDForum. Page generated in 0.03375 seconds