Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » How to close editor when Eclipse terminates?
How to close editor when Eclipse terminates? [message #293035] Sun, 16 October 2005 01:36
Eclipse UserFriend
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
Previous Topic:I seem to have broken the task list ...
Next Topic:Programmaticly force save of all "dirty" editors
Goto Forum:
  


Current Time: Sat Jul 12 00:39:09 EDT 2025

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

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

Back to the top