Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335889 - E4Application#stop cannot shutdown the workbench
Summary: E4Application#stop cannot shutdown the workbench
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: 4.1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-31 13:50 EST by Brian de Alwis CLA
Modified: 2011-05-30 10:47 EDT (History)
1 user (show)

See Also:


Attachments
patch to stash the workbench in a field and cause E4Application#stop() to call #close() (948 bytes, patch)
2011-02-16 18:18 EST, Brian de Alwis CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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