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: 140
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
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 08:09 Go to previous message
Christoph Keimel is currently offline Christoph KeimelFriend
Messages: 409
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:Fragments not visible after Product Export
Goto Forum:
  


Current Time: Fri May 29 08:32:00 GMT 2015

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

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