Steffi S. Steffi S. - 2 months ago 9x
Java Question

The Secret Of Restoring Views

After switching from Eclipse 3.7 to Eclipse 4.5 we stumbled over the bug that the application sometimes restores views (but as far as we can tell, never editors, even though that's now the same thing).

The most prominent example is the exit action (

), which makes the application started next restore views. The little X on the top right however does nothing of the sort. Killing the application process will store the views about half of the time.

We don't want any restoring (because our views usually show database objects, and these cannot be shown before a connection to the database is created).

The only method I found that sounds even similar to what I want is:

public class ApplicationWorkbenchAdvisor extends SpaceWorkbenchAdvisor {

public void initialize(IWorkbenchConfigurer configurer) {

...but as far as I can tell this does nothing at all (doesn't matter if true or false).

So how do I prevent Eclipse from trying to restore Views (and failing miserably)?


Specify false for the restorable option on the org.eclipse.ui.views declaration of the view in the plugin.xml.

You can stop any attempt to restore the persisted state with the -clearPersistedState option in the RCP .ini file. You can stop the persistence on exit with the -persistState false .ini option.