Editors closed upon open [message #242562] |
Wed, 19 May 2004 11:00  |
Eclipse User |
|
|
|
Originally posted by: 50295.web.de
My project wizard successfully creates a number of files which I would
like to open after they are created, but surprisingly, the files are
closed immidieately after they are opened. Why is this happening?
Code sniipet:
private void openEditor(String type){
final String modelType = type;
String fileExtension = "";
if (modelType.equals(ModelConstants.FM_TYPE)) fileExtension = ".xfm";
else if (modelType.equals(ModelConstants.CCFM_TYPE)) fileExtension =
".ccfm";
final IFile model = m_ProjectHandle.getFile(new Path (m_ProjectName +
fileExtension));
IWorkbench workbench =
m_View.getSite().getWorkbenchWindow().getWorkbench();
IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage();
if (page != null){
IEditorRegistry ereg = workbench.getEditorRegistry();
IEditorDescriptor editorDescriptor =
ereg.getDefaultEditor(model.getName());
if (editorDescriptor == null){
editorDescriptor = ereg.getDefaultEditor();
}
try {
// page.openEditor(model);
page.openEditor(new FileEditorInput(model),editorDescriptor.getId());
} catch (PartInitException e) {
e.printStackTrace();
}
}
}
|
|
|
Re: Editors closed upon open [message #242615 is a reply to message #242562] |
Wed, 19 May 2004 12:15  |
Eclipse User |
|
|
|
Originally posted by: 50295.web.de
> My project wizard successfully creates a number of files which I would
> like to open after they are created, but surprisingly, the files are
> closed immidieately after they are opened. Why is this happening?
>
>
I'm thinking that somehow, the method closeEditor() is being called
somehow but I dont know how, where, or by whom. Can the debugger be made
to watch for this method invocation?
Thanks
- Olumide
|
|
|
Powered by
FUDForum. Page generated in 0.10577 seconds