|
|
|
Re: Maintaining state of an AbstractSourceProvider [message #481834 is a reply to message #481216] |
Mon, 24 August 2009 13:50 |
|
IMemento is used to store state information. Most commonly, a view can store session data when the view is open and eclipse is stopped/restarted. This saveState/restoreState code is not called for simply closing the view and re-opening it, however.
RCP apps have an opportunity to also save/restore application state from their WorkbenchAdvisor. your application would have to find the information to save, or your producer of the information would have to post it somewhere useful the workbench advisor can find it. But it's up to you to figure out how to save your state to an IMemento
For example, a common pattern is to have a view save information in its activator, ex: Activator.getDefault().getInfoMap().put("useName", "Paul Webster").
In the Activator#stop(*) method, info map is written out to the plugin state location. In the Activator#start(*) method, the state location file is read and the info map is populated.
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
Powered by
FUDForum. Page generated in 0.03169 seconds