[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools] dipose() of an editor

Hello,

I have written a multi-page editor for eclipse.
It uses a .tmp copy as a backup. The user will be working on that file
instead of the real file. 
So on startup, I create that backup file and I set the input of the editor
to the backup file.

In the dipose() method of the editor I want to change the input of the
editor to the real input again. I also delete the backup file. So I use
this code:
 
public void dispose() {
	setInput(realFileEditorInput);
	try {
		workingFile.delete(true,null);
	} catch (CoreException e) {
		e.printStackTrace();
	}
	super.dispose();
}

This seemed correct at the first sight, but apparently the
setInput(realFileEditorInput) is not working fine in this dispose.
Because if I shut down eclipse and start it up again I get an error that
the backup file was not found and that the workbench couldn't be restored.

Is there a solution for this issue?

Thanks,

Peter