|Re: Is it possible to stop an editor from being restored if it is open when the workbench is closed? [message #528546 is a reply to message #528503]
||Tue, 20 April 2010 17:49
| Alan Boxall
Registered: July 2009
Paul Webster wrote:|
> It's not the editor that determines re-open, it's the editor input.
> org.eclipse.ui.IEditorInput.getPersistable() and exists(), for example.
> In the IDE case, I'm not sure how you could make sure those editors
> close and aren't persisted, unless you provide your own IEditorInput to
> In an RCP app you might be able to close editors that you don't want
> persisted in org.eclipse.ui.application.WorkbenchAdvisor.preShutdown()
> or one of the other advisor methods (maybe window preClose()).
I am able to supply the editorinput so I tried what you suggested.
FileEditorInput says it is not to be extended so it looks like I'll need to implement an
IFileEditorInput that behaves like a FileEditorInput but returns null for getPersistable().
I ran a quick test by extending FileEditorInput and overriding getPersistable() and it did what I
wanted. Files open at IDE shutdown are not re-opened at the next startup.
Thanks for pointing me in right direction.
Powered by FUDForum
. Page generated in 0.01726 seconds