Bug 413952 - [RCP] WorkbenchConfigurer.getSaveAndRestore() is not called anywhere
Summary: [RCP] WorkbenchConfigurer.getSaveAndRestore() is not called anywhere
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Bartosz Popiela CLA
QA Contact: Brian de Alwis CLA
URL:
Whiteboard: stalebug
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2013-07-29 17:18 EDT by Janice Li CLA
Modified: 2019-12-30 13:48 EST (History)
7 users (show)

See Also:


Attachments
Test plugin (17.30 KB, application/zip)
2013-07-29 17:18 EDT, Janice Li CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Janice Li CLA 2013-07-29 17:18:26 EDT
Created attachment 233913 [details]
Test plugin

In our workbench, we call WorkbenchConfigurer.setSaveAndRestore(false). But it doesn't take effect. The workbench layout is still saved.

To reproduce, use the attached plugin. Launch the RCP, Press F1 button to open the help for the view. If it doesn't work for the first time due to bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=400042, close the RCP, and re-lauch it.

After the help view shows up, close the RCP, and re-lauch it. The help view should show up automatically in the workbench which it should not since we called 'WorkbenchConfigurer.setSaveAndRestore(false)' in ApplicationWorkbenchAdvisor.

I searched 'WorkbenchConfigurer.getSaveAndRestore()', seems it is not called. This is a regression from E4.
Comment 1 Daniel Rolka CLA 2013-07-31 04:19:28 EDT
(In reply to comment #0)
> Created attachment 233913 [details]
> Test plugin
> 
> In our workbench, we call WorkbenchConfigurer.setSaveAndRestore(false). But
> it doesn't take effect. The workbench layout is still saved.
> 
> To reproduce, use the attached plugin. Launch the RCP, Press F1 button to
> open the help for the view. If it doesn't work for the first time due to
> bugzilla https://bugs.eclipse.org/bugs/show_bug.cgi?id=400042, close the
> RCP, and re-lauch it.
> 
> After the help view shows up, close the RCP, and re-lauch it. The help view
> should show up automatically in the workbench which it should not since we
> called 'WorkbenchConfigurer.setSaveAndRestore(false)' in
> ApplicationWorkbenchAdvisor.
> 
> I searched 'WorkbenchConfigurer.getSaveAndRestore()', seems it is not
> called. This is a regression from E4.

I believe the 'WorkbenchConfigurer.getSaveAndRestore' is not supported in the e4. Use the '-clearPersistedState' or '-data @none'launching options instead.

Please let us know if it solves your issue and we can close the bug

Daniel
Comment 2 Paul Webster CLA 2013-07-31 06:07:21 EDT
(In reply to comment #1)
> 
> I believe the 'WorkbenchConfigurer.getSaveAndRestore' is not supported in
> the e4. Use the '-clearPersistedState' or '-data @none'launching options
> instead.

Those are workarounds, but our longterm goal is to support that for compatibility.

PW
Comment 3 Phil Beauvoir CLA 2014-08-15 09:08:09 EDT
Just discovered that WorkbenchConfigurer.setSaveAndRestore(false) does nothing in my RCP app built with 4.4.

:sigh:
Comment 4 Wojciech Sudol CLA 2014-11-18 15:14:25 EST
The simplest scenario to reproduce the issue:
1. Create and run the RCP Mail Template project.
2. Relocate the Message view (e.g. from right to bottom).
3. Close and restart the app (make sure the 'Clear' option in 'Run Configuration' is NOT checked).

Expected behavior:
After restart the layout is reverted to the initial state.

Current behavior:
After restart the layout is still in the modified state.

Reproduced in Eclipse 4.4.1.
Comment 5 Bartosz Popiela CLA 2015-03-04 13:26:01 EST
I'll try to solve this bug.
Comment 6 Eclipse Genie CLA 2015-06-09 18:33:41 EDT
New Gerrit change created: https://git.eclipse.org/r/49858
Comment 8 Eclipse Genie CLA 2015-10-27 07:23:04 EDT
New Gerrit change created: https://git.eclipse.org/r/58989
Comment 10 Brian de Alwis CLA 2015-10-27 07:29:33 EDT
Oops reverted and will apply for M4
Comment 11 Eclipse Genie CLA 2015-11-10 18:19:42 EST
New Gerrit change created: https://git.eclipse.org/r/60102
Comment 12 Brian de Alwis CLA 2015-11-13 14:49:04 EST
I was looking at WorkbenchConfigurerTest which has some ignored tests, disabled due to this bug.  But these tests still fail as E3.x defaulted to *not* persisting the workbench, the opposite of E4's default.

Possible approaches:

(1) Change the default for E3.x, and document the change in the migration guide. Chances are most apps explicitly call setSaveAndRestore() in their WorkbenchAdvisor initialize() methods.

(2) Add some code to workbench startup to call setSaveAndRestore(false).  But we need to deal with the invoker explicitly specifying -persistState on the command line.  This would likely entail:

  * Modifying E4Application to make the default value of PERSIST_STATE be a static

  * Change o.e.ui.internal.Workbench#createAndRunWorkbench() to set the default value for PERSIST_STATE on E4Application

(3) Change E4Application#createE4Workbench to pass in the default for PERSIST_STATE


I think (3) is the easiest.
Comment 13 Lars Vogel CLA 2016-04-20 12:07:45 EDT
Mass move to 4.7 as M7 is approaching. Please move back in case you are planning to fix it for Neon.
Comment 14 Eclipse Genie CLA 2019-12-30 13:48:04 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.