Persisting the current perspective state of an RCP
Read the article on my new blog under http://blog.js-development.com/2008/11/persisting-current-perspective-state-of.html
If you're developing on Eclipse RCP applications it may be interesting to save the perspective layout and open views of the user s.t. when he launches the application the next time, everything looks as before. That may sound difficult but actually it is really simple.
In your ApplicationWorkbenchAdvisor.java, in the initialize(IWorkbenchConfigurer) just write the following:
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
...
@Override
public void initialize(IWorkbenchConfigurer configurer) {
super.initialize(configurer);
configurer.setSaveAndRestore(true);
...
}
...
}
This should work fine. In case it doesn't, try to get the WorkbenchConfigurer by calling the method getWorkbenchConfigurer() and invoke the setSaveAndRestore(...) on that.


2 Comments:
Hi Juri,
I'm happy to see, that you found the time to work with eclipse RCP ...
Hi,
nice to see that you follow my blog-posts :)
Well actually I don't really have the time to work on Eclipse RCP in my free time, but for a course at the University we have the task to take an Open Source project with LOC > 50.000 and to work on it (modify, add new features etc...). So I (actually me and my group) took the occasion to work on an RCP application in order to have some further practice on them. We've taken RSSOwl which is by the way a very interesting and good structured RCP application. You could take a look at it if you wish to.
Bye
Post a Comment