use of aQute.bnd.build.ReflectAction in project bndtools by bndtools.
the class Activator method start.
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext )
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
instance = this;
this.context = context;
Hashtable<String, Object> p = new Hashtable<String, Object>();
// p.put(Action.ACTION_MENU, new String[] {"a:b", "a:c", "a:d",
// "a:d:e"});
context.registerService(Action.class.getName(), new ReflectAction(""), p);
// We want the repoindex bundle to start so it registers its service.
// (sigh... Eclipse)
Bundle repoindex = BundleUtils.findBundle(context, "org.osgi.impl.bundle.repoindex.lib", new VersionRange("0"));
if (repoindex != null) {
try {
repoindex.start();
} catch (BundleException e) {
getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Failed to start repository indexer plugin.", e));
}
} else {
getLog().log(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Repository indexer plugin is not available.", null));
}
Hashtable<String, Object> dataUrlHandlerProps = new Hashtable<>();
dataUrlHandlerProps.put(URLConstants.URL_HANDLER_PROTOCOL, DataURLStreamHandler.PROTOCOL);
dataUrlHandlerReg = context.registerService(URLStreamHandlerService.class, new DataURLStreamHandler(), dataUrlHandlerProps);
}
Aggregations