Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » How to close the workbench from an other bundle
How to close the workbench from an other bundle [message #1774165] Wed, 11 October 2017 08:43 Go to next message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
Hi, I have an eclipse e4 app and a bundle that has no dependencies to the app bundle. From this other bundle I want to quit the app if some condition is not fullfilled. How can I obtain programmatically a workbench to close the application? This bundle has no parts (Just headless code and some wizards (JFace). Thank you!
Re: How to close the workbench from an other bundle [message #1774402 is a reply to message #1774165] Fri, 13 October 2017 17:05 Go to previous messageGo to next message
Eclipse UserFriend
You can use `Display#close()`, though this calls out to all `SWT.Close` listeners which can refuse the attempt.
You could also use `Display#dispose()`, though that's fairly brutish.

Alternatively, the E4Application is an Equinox IApplication, and these are available from the service registry, and you can issue a #stop() to the IApplication instance.
Re: How to close the workbench from an other bundle (SOLVED) [message #1774536 is a reply to message #1774402] Mon, 16 October 2017 21:16 Go to previous message
Christian Eugster is currently offline Christian EugsterFriend
Messages: 203
Registered: July 2009
Location: St. Gallen Switzerland
Senior Member
HI Brian

many thanks for your hints. Because I did not find any service with interface IApplication I tried to close the IWorkbench that is available from service registry. But I had then to use Display.close() because the workbench (thought available) did not as I expected. Display.close() seems to me the best of the variants.
Previous Topic:SceneBuilder integration
Next Topic:How to change the background color of the main menu by CSS in eclipse?
Goto Forum:
  


Current Time: Thu Apr 25 22:05:59 GMT 2024

Powered by FUDForum. Page generated in 0.02204 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top