Differences

This shows you the differences between two versions of the page.

Link to this comparison view

get_eclipse_context [2019/02/05 21:18]
get_eclipse_context [2021/04/05 11:23] (current)
Line 1: Line 1:
 +====== Get Eclipse Context ======
 +In e4 there are multiple contexts available. One of those contexts can be active.
  
 +To get an Eclipse service into an OSGi component the Eclipse context can be used. The Eclipse context can be retrieved through the bundle context.
 +
 +  Bundle bundle = FrameworkUtil.getBundle( MyLogManager.class );
 +  IEclipseContext context = EclipseContextFactory.getServiceContext( bundle.getBundleContext());
 +
 +<note>The downside of this is that your pure OSGi bundle now depends on e4 packages and the context only holds OSGi service, no e4 services.</note>
 +
 +{{tag>eclipse e4}}