Save/Restore workbench and view state [message #256673] |
Tue, 29 June 2004 14:13 |
Eclipse User |
|
|
|
Originally posted by: elvis.graceland.com
Two separate questions:
1.) I have a view that needs to save and restore state. I've overridden
ViewPart's init method to capture the IMemento obj which I intend to use in
createPartControl. The problem I have is that the IMemento is always null.
public void init(IViewSite site, IMemento memento) throws PartInitException
{
super.init(site);
// memento is always null !!!
}
2.) How do I instruct the workbench to persist and restore it's state (ie:
layout of current perspective, location and bounds of workbench window,
etc)? How does this mesh with my IPerspectiveFactory's createInitialLayout
method?
Thanks.
|
|
|
Re: Save/Restore workbench and view state [message #256802 is a reply to message #256673] |
Tue, 29 June 2004 18:45 |
Eclipse User |
|
|
|
Originally posted by: elvis.graceland.com
Found the answer to both questions. I needed to do the following in my
WorkbenchAdvisor subclass:
public void initialize(IWorkbenchConfigurer configurer) {
configurer.setSaveAndRestore(true);
super.initialize(configurer);
}
I didn't realize that I need to invoke setSaveAndRestore so early in the
startup!
|
|
|
Powered by
FUDForum. Page generated in 0.03642 seconds