|
Re: Odd behavior if E4 application closed via 'X' button [message #1228296 is a reply to message #1228237] |
Mon, 06 January 2014 22:33 |
Thomas Schindl Messages: 6651 Registered: July 2009 |
Senior Member |
|
|
On 06.01.14 19:45, Joseph Gagnon wrote:
> I am exploring developing an eclipse 4 RCP application, using JavaFX
> (efxclipse) as the renderer on a linux (CentOS 6.5) system. The app
> window consists of a main menu and single part stack that is initially
> empty. The user makes choices from the menu and the controller logic
> configures the part to be displayed in the part stack. One of the menu
> choices is used to exit the application and its handler simply closes
> the workbench.
>
> I was testing the application and noticed that one time the application
> opened up with the parts already opened on the part stack. This was
> completely unexpected as I'm not doing anything to preserve any state as
> far as what was open when the application was exited. I did some
> experiments and noticed that if I exit the application via my exit menu
> (and command/handler), when it is run again, it comes up "empty" like I
> would expect. However, if I exit the application by just clicking the
> "X" button in the upper-right, the next time the application is run, it
> comes up with whatever parts I had open when it was last closed.
> Obviously there is some sort of preservation of state going on behind
> the scenes.
>
> I'd like to know what's happening here and if it can be controlled - I
> may want to preserve the user's last "part configuration" so that it
> comes up the next time without their having to select the menu choices
> again. In the meantime, I'd like the application to come up in its
> initial empty state when it's run, regardless of how it was last shut down.
>
Perserving the state is the default. If you always want it come up with
a clean state you can pass -clearPersistedState as a program argument or
set it to true using the product extension point.
How does your handler close the application? If the shutdown process is
running in its normal way it will *ALWAYS* save the state.
Tom
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.01976 seconds