Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse 4 » Custom StatusReporter(override WorkbenchStatusReporter)(Registering Service no longer working)
Custom StatusReporter(override WorkbenchStatusReporter) [message #1752020] Tue, 17 January 2017 23:02
Shaun McCluskey is currently offline Shaun McCluskeyFriend
Messages: 1
Registered: January 2017
Junior Member
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.
Previous Topic:Pure E4 Eclipse IDE replacement available?
Next Topic:eclipse ui problem with fedora gnome 3
Goto Forum:
  


Current Time: Thu Apr 25 01:38:26 GMT 2024

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

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

Back to the top