Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 06:43 Go to next message
Sumit Singh is currently offline Sumit SinghFriend
Messages: 141
Registered: October 2012
Location: Bangalore
Senior Member

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
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.

Re: How restart RCP application with -clearPersistedState. [message #1385635 is a reply to message #1385493] Tue, 10 June 2014 08:09 Go to previous message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 482
Registered: December 2010
Location: Germany
Senior Member
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: Thu Jun 17 23:21:24 GMT 2021

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

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

Back to the top