Bug 571412 - Support for restart in @PostContextCreate method of lifecycle manager
Summary: Support for restart in @PostContextCreate method of lifecycle manager
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.20   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-UI-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-22 15:05 EST by Patrick Paulin CLA
Modified: 2021-02-22 15:05 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Paulin CLA 2021-02-22 15:05:36 EST
I see that the e(fx)clipse project has support for restarting an Eclipse RCP application through return values in the method annotated with @PostContextCreate. The approach is described here:

https://tomsondev.bestsolution.at/2014/11/03/efxclipse-1-1-new-features-api-to-restart-your-e4-app-on-startup/

https://bugs.eclipse.org/bugs/show_bug.cgi?id=421153

Would it be possible to duplicate this approach in the E4Application class? The use-case is doing auto-update logic in the lifecycle handler and then requesting a restart if updates were applied. Because the workbench instance has not yet been created, it's not possible to call workbench.restart().

The workaround currently is to add a listener for the UIEvents.UILifeCycle.APP_STARTUP_COMPLETE event. This is possible but it results in the workbench window flashing before the restart occurs.

https://stackoverflow.com/questions/28507982/eclipse-rcp-how-to-shutdown-before-workbench-initializes