I have an app that has a custom StatusRpeorter that overrides the WorkbenchStatusReporter. My predicessor had some difficulty getting it to work.
His original topic is here: http://www.eclipse.org/forums/index.php/m/985707/#msg_985707
His solution was to add the service programatically in the Activator class:
public void start(BundleContext bundleContext) throws Exception {
Dictionary<String, Object> properties = new Hashtable<String, Object>();
properties.put("service.context.key", "org.eclipse.e4.core.services.statusreporter.StatusReporter");
StatusReporterContextFunction implementation = new StatusReporterContextFunction();
bundleContext.registerService("org.eclipse.e4.core.contexts.IContextFunction", implementation, properties);
Activator.context = bundleContext;
}
This worked great until we had to upgrade to eclipse 4.4 from 4.2.
Now this approach doesn't work. I even tried to add it declaratively through the Manifest file but that didn't work either.
Like this:
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="hxxp://www.osgi.org/xmlns/scr/v1.1.0"
name="com.company.blah.productname.StatusReporter">
<implementation class="com.company.blah.productname.StatusReporterContextFunction"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
<property name="service.context.key" type="String"
value="org.eclipse.e4.core.services.statusreporter.StatusReporter"/>
</scr:component>
Was there a change how a service needs to be registered for something like StatusReporter since its a core service?
This worked in the eclipse 4.2 environment but not 4.4.