Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » ClearPersistedState in code
ClearPersistedState in code [message #1072698] Tue, 23 July 2013 10:03 Go to next message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 163
Registered: January 2013
Senior Member
Hi,

I'd like to let the user decide, if the current workbench state is persisted or saved or restored or something like that Smile . So I thought it could be done like that:
mApplication.getContext().set(E4Workbench.CLEAR_PERSISTED_STATE, "true");

But this doesn't have any effect and the next time the RCP is started the persisted state is restored.

Thanks for comments and hints
Bastian
Re: ClearPersistedState in code [message #1072819 is a reply to message #1072698] Tue, 23 July 2013 15:17 Go to previous messageGo to next message
Eric Moffatt is currently offline Eric MoffattFriend
Messages: 118
Registered: July 2009
Senior Member
Using the context won't work since it's not itself persisted.

There is a flag '-clearPersistedState' that will force the ui to always
show up in its original state. Perhaps this is what you want.

See Lars Vogel's tutorial for more info:

http://www.vogella.com/articles/EclipseRCP/article.html#tutorial_clearpesistence

Re: ClearPersistedState in code [message #1072822 is a reply to message #1072698] Tue, 23 July 2013 15:22 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

That's because the CLEAR_PERSISTED_STATE flag is intended to be used with a product or listed as a JVM launch arg. There are two things that should be kept separate; those are the ideas of loading the last application model and deleting the last application model. (Note: Both of these only apply when the application is initially loading.)

Setting either flag in the context doesn't affect anything, the flags need to be available at launch.

JD
Re: ClearPersistedState in code [message #1072829 is a reply to message #1072822] Tue, 23 July 2013 15:36 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 5487
Registered: July 2009
Senior Member
He could enable his/her own model loading which e.g. uses a preference
to note if a the model should be coming from a restored state or not.

Tom

On 23.07.13 17:22, Joseph Carroll wrote:
> That's because the CLEAR_PERSISTED_STATE flag is intended to be used
> with a product or listed as a JVM launch arg. There are two things that
> should be kept separate; those are the ideas of loading the last
> application model and deleting the last application model. (Note: Both
> of these only apply when the application is initially loading.)
>
> Setting either flag in the context doesn't affect anything, the flags
> need to be available at launch.
>
> JD
Re: ClearPersistedState in code [message #1073083 is a reply to message #1072829] Wed, 24 July 2013 05:24 Go to previous message
Bastian Wagenfeld is currently offline Bastian WagenfeldFriend
Messages: 163
Registered: January 2013
Senior Member
Hi,

ok thanks. Than I'll try to solve it in a different way.
Thanks for all the answers!

Bastian
Previous Topic:placeholders and references to parts
Next Topic:Editor behavior
Goto Forum:
  


Current Time: Sat Dec 20 23:43:52 GMT 2014

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

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