Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Editors closed upon open
Editors closed upon open [message #242562] Wed, 19 May 2004 11:00 Go to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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
Previous Topic:Keyboard shortcut for Jumping from one task to the next
Next Topic:[Eclipse 3.0M8] Startup complain (incorrectly) that "Workspace is in use"
Goto Forum:
  


Current Time: Sat Jul 12 22:41:07 EDT 2025

Powered by FUDForum. Page generated in 0.10577 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top