I am developing an Eclipse Plugin with my custom text editor.
I need to open files programmatically inside this custom editor. When I open it using Eclipse's DefaultTextEditor, the file opens file and I am able to edit the text, etc.
But when I try to open the file using my editor, the editor turns up blank and is uneditable. Here is the source that I am using.
File file = new File(filename);
IFileStore fileOnLocalDisk = EFS.getLocalFileSystem().getStore(file.toURI());
FileStoreEditorInput editorInput = new FileStoreEditorInput(fileOnLocalDisk);
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
IWorkbenchPage page = window.getActivePage();
try {
// this works fine
page.openEditor(editorInput, "org.eclipse.ui.DefaultTextEditor");
// this is where the issue is
page.openEditor(editorInput, "MyEditor.editor");
} catch (PartInitException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Thanks
initmethod and see if it even gets here.