I have Eclipse RCP application. My own IntroPart extends org.eclipse.ui.part.IntroPart.
Through inheritance I got this method:
@Override
public void saveState(IMemento memento) {
}
Here it is stated that when the workbench is shut down, the method saveState is called on all open views. But this is true only if I close my whole application.
What should I do, to save the intro page state before if I close only this page, not the hole application?
Your link to the FAQ answers that:
This is an example on how to use IDialogSettings to persist the state of an IntroPart when it is closed and how to restore it when it is created. MyIntroPart is an IntroPart that has a
Textwidget. The displayed text is saved when the IntroPart is closed and restored when it is created.To get the
partClosedevent, MyIntroPart implements IPartListener2 and registers itself with the PartService.This will restore the text to the text widget.
MyIntroPart implements
partClosedof IPartListener2 to save dialog settings when the view is closed:Thanks to fredrik for pointing out that no loading from or saving to a file is required here.