Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 335889

Summary: E4Application#stop cannot shutdown the workbench
Product: [Eclipse Project] e4 Reporter: Brian de Alwis <bsd>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: remy.suen
Version: unspecified   
Target Milestone: 4.1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch to stash the workbench in a field and cause E4Application#stop() to call #close() none

Description Brian de Alwis CLA 2011-01-31 13:50:56 EST
E4Application#stop() currently does nothing.  As a result, if you trigger a shutdown of the OSGi runtime programmatically (e.g., getBundle(0).stop()), the UI workbench is not closed.  Any subsequent clicking or interaction with the UI workbench triggers a cascade of errors.

I think E4Application should hold onto the workbench in a field.  The stop() method should call workbench.close().
Comment 1 Remy Suen CLA 2011-02-04 10:47:11 EST
Does calling stop() on the IPresentationEngine work?
Comment 2 Brian de Alwis CLA 2011-02-08 10:23:12 EST
(In reply to comment #1)
> Does calling stop() on the IPresentationEngine work?

IPE#stop() does work; in fact, E4Workbench#close() simply calls IPE#stop().

But E4Workbench#close() could have other things to do in the future.

My workaround for now is to call IWorkbench#close() from the Exit command handler (org.eclipse.ui.file.exit).
Comment 3 Brian de Alwis CLA 2011-02-16 18:18:25 EST
Created attachment 189143 [details]
patch to stash the workbench in a field and cause E4Application#stop() to call #close()

Created a patch to stash the workbench in a field and cause E4Application#stop() to call E4Workbench#close()
Comment 4 Brian de Alwis CLA 2011-03-29 09:16:33 EDT
Committed to HEAD