I'm currently working on my first Eclipse e4 RCP app using Eclipse 4.2M6. I'm developing a main plugin which has the core code for my app and defines a number of services as extensions to allow other plugins/fragments to hook into the app to add new functionality.
My main service has methods which the other plugins should use to register new functionality, and to add programatically to the model of the main app. I'm however unsure how to get these plugins to lookup the service and register themselves when the plugin is started.
An example:
My interface for my service in the main plugin:
public interface FeedManager {
boolean registerFeed(Feed service);
boolean unregisterFeed(Feed service);
IObservableList getFeeds();
}
What I'm wanting in second plugin:
public class TestFeed {
///this method could be in a constructor or @PostConstruct method instead
@Inject
public void init(FeedManager manager){
Feed feed = new Feed();
feed.setName("Test feed");
manager.registerFeed(feed);
}
}