The persistence of e4

less than 1 minute read

In Eclipse 3.x you can remember the current application state (the user’s layout and window size) between application sessions, via the setting configurer.setSaveAndRestore(true); in the initialize method of ApplicationWorkbenchAdvisor. See Eclipse RCP Tips and Tricks for details.

Eclipse e4 has no ApplicationWorkbenchAdvisor class and the application model has no property to set this. Therefore you may assume that you cannot influence the e4 behavior.

But of course this is not true. :-)

e4 has two command line options to get a similar behavior then in Eclipse 3.6. If you use the command line option “-clearPersistedState” then the user changes will be deleted.

I believe “-deltaRestore” is intended to work similar to setSaveAndRestore(true). Currently in Eclipse 4.1 M2 the state is always saved but I think that is a minor bug. See for details.

Many thanks to Remy Suen for the tip on these parameters.

Once the bug discussion has been finished I will update my Eclipse 4.0 Tutorial.

[UPDATE: The parameter is not called deltaIgnore instead of “deltaRestore”.]