How to close editor when Eclipse terminates? [message #293035] |
Sun, 16 October 2005 01:36 |
Eclipse User |
|
|
|
Originally posted by: davros.covad.net
I have an editor (IEditorPart) open and I know the IFile that goes along
with it. I want to delete the file and close the editor when Eclipse
terminates/closes. How do I do this? The file deletes just fine, but I cant
seem to get the editor to close. When Eclipse fires up again, theres the
editor, and its moaning about the file for the editor not being found
(because I deleted it).
I tried:
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActi vePage().closeEditor(myEditor),
but getActivePage() comes back null when closing Eclipse.
I also tried casting IEditorPart over to AbstractTextEditor and call
close(), but that didnt do anything either. Whats the "right" way to clean
up editors and files when Eclipse closes?
BTW, what is the listener I should be listening to when Eclipse closes
anyway?
Thanks,
Dave
|
|
|
Powered by
FUDForum. Page generated in 0.05761 seconds