Juri Strumpflohner
Juri Strumpflohner Juri is a full stack developer and tech lead with a special passion for the web and frontend development. He creates online videos for Egghead.io, writes articles on his blog and for tech magazines, speaks at conferences and holds training workshops. Juri is also a recognized Google Developer Expert in Web Technologies

Persisting the current perspective state of an RCP

1 min read

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.
Questions? Thoughts? Hit me up on Twitter
comments powered by Disqus