Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Headless Eclipse/E4 Applications?(Is it possible use (parts of) the Eclipse/E4 framework in applications without a GUI?)
Headless Eclipse/E4 Applications? [message #1772207] Wed, 06 September 2017 15:31 Go to next message
Nils Loose is currently offline Nils LooseFriend
Messages: 5
Registered: September 2017
Junior Member
Hello everyone,

together with two colleagues I'm working on migrating a Java application to OSGI/Equinox. We are interested in also using Eclipse RCP/E4 technology, especially p2 update sites, and reusing some GUI elements like for example the property dialog from eclipse would also be of interest.

One possible problem: Our application can be switched to different modes - an end user application mode with a (currently Swing-based) graphical user interface, but also different background service modes with limited (tray icon) or no visualization.

Now the main idea of Eclipse RCP/E4 obviously is developing graphical applications. Is it also possible to run Eclipse-based Applications without a graphical user interface, or at least to use parts of the framework - like p2 update sites - in applications that come without a workbench etc.? Or are we limited to pure OSGI when working without a GUI?

Thank you very much and best regards,

Nils
Re: Headless Eclipse/E4 Applications? [message #1772976 is a reply to message #1772207] Tue, 19 September 2017 15:41 Go to previous messageGo to next message
Eclipse UserFriend
RCP is basically the Equinox/OSGi runtime with UI code. p2's core is independent of RCP. You can create your own Equinox IApplications, and you can run Swing code within your Equinox IApplication. You can also use p2 to do updates too, but you won't want/be able to use the p2 UI code, as it is centred around RCP.
Re: Headless Eclipse/E4 Applications? [message #1772980 is a reply to message #1772976] Tue, 19 September 2017 16:06 Go to previous messageGo to next message
Hanno Wagner is currently offline Hanno WagnerFriend
Messages: 12
Registered: April 2017
Junior Member
Thanks very much for your reply. I am a colleague of Nils' and reply because he is currently unavailable.
That's both great news, yet the question for us is: How can we do both things, start Swing from SWT and run a p2 update headless?
Do you have a hint, code snippet, link, some resource or tutorial where we can find information for both problems?
Re: Headless Eclipse/E4 Applications? [message #1773113 is a reply to message #1772980] Thu, 21 September 2017 18:11 Go to previous message
Eclipse UserFriend
Think of the Eclipse IApplication class as a fancy main(): they're just entry points. You can have multiple entry points, and they can do SWT and AWT, providing you respect their threading requirements.

SWT and AWT/Swing can be combined in the same app providing you respect these threading requirements. Both SWT and Swing/AWT require that UI work is done on a particular thread; actions from other threads will result in exceptions. AWT allows you to use any particular thread, whereas SWT usually requires the SWT thread to be the first thread (the "main" thread). One risk of combining SWT and AWT is deadlock, especially if you have callbacks from one trigger work on the other (which is fairly common). Tom Schindl discovered that there's a way to run SWT and AWT on the same thread in Java 8, which greatly helps alleviate that problem.

On the other hand, your p2 work can be run from any thread.

So you could have a single IApplication that does some further dispatch internally.
Previous Topic:Behavior of FastViews (TrimBar) in detached Windows
Next Topic:Tycho build fails missing org.eclipse.equinox.executable.feature.group 0.0.0
Goto Forum:
  


Current Time: Tue Apr 23 06:11:04 GMT 2024

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

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

Back to the top