Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » How restart RCP application with -clearPersistedState.(How restart RCP application with -clearPersistedState.)
How restart RCP application with -clearPersistedState. [message #1385493] Sat, 07 June 2014 02:43 Go to next message
Eclipse UserFriend
I'm working on e4 (kepler) RCP application based on compatibility layer.

I want to restart my RCP application with -clearPersistedState option programmatically.

But by default
PlatformUI.getWorkbench().restart()
doesn't have any option to restart with clearPersistedState.

Is there is any other way to do this, even any workaround will also be helpful.


Thanks.
Re: How restart RCP application with -clearPersistedState. [message #1385635 is a reply to message #1385493] Tue, 10 June 2014 04:09 Go to previous message
Eclipse UserFriend
our workaround for this (not using the compatibility layer though) is:

  • wrap the E4Application in your own implementation of IApplication (E4Application is internal API, so you will have to ignore the "discouraged access")
  • before calling IWorkbench.restart() -> save a flag as a preference
  • on starting the application: check if your flag is set. If so, set the system property E4Workbench.CLEAR_PERSISTED_STATE to true and clean your preference flag.

System.setProperty(E4Workbench.CLEAR_PERSISTED_STATE, "true"); //$NON-NLS-1$

Hope this helps!
Previous Topic:Applying CSS on every Activate event
Next Topic:Breaking change in nightly builds
Goto Forum:
  


Current Time: Fri Jul 04 02:46:52 EDT 2025

Powered by FUDForum. Page generated in 0.05522 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top