Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » implement function in my plugin that can be used by other plugins
implement function in my plugin that can be used by other plugins [message #820944] Wed, 14 March 2012 15:21 Go to next message
Mikael Petterson is currently offline Mikael Petterson
Messages: 150
Registered: July 2009
Senior Member
Hi,

I am have a plugin for eclipse that I am maintaining. A user wants a function in my plugin, a listener that can notify about specific operations. Then he want to receive these notifications.

How shall I make it possible for him to get notifications from my plugin to his plugin?

All hints are very welcome.

br,

//mike
Re: implement function in my plugin that can be used by other plugins [message #821312 is a reply to message #820944] Thu, 15 March 2012 03:30 Go to previous message
Thorsten Schlathölter is currently offline Thorsten Schlathölter
Messages: 207
Registered: February 2012
Location: Düsseldorf
Senior Member
Design a ServiceInterface, provide it - maybe - in a separate plugin. Implement a Service that implements your ServiceInterface. Register the service with org.eclipse.ui.services. The user can then request the service
from the Workbench and register his listener.

IMyNotificationService service = PlatformUI.getWorkbench().getService(IMyNotificationService.class)
if (service!=null)
{
   service.addListener(myServiceListener);
}
Previous Topic:Indigo and Maven (m2e) Integration suddenly stopped working
Next Topic:Eclipse Source Builds
Goto Forum:
  


Current Time: Fri Apr 18 16:56:50 EDT 2014

Powered by FUDForum. Page generated in 0.03633 seconds