Bug 571412

Summary: Support for restart in @PostContextCreate method of lifecycle manager
Product: [Eclipse Project] Platform Reporter: Patrick Paulin <patrick>
Component: UIAssignee: Platform-UI-Inbox <Platform-UI-Inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.20   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

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