DI and own Objects (EMF) [message #743275] |
Fri, 21 October 2011 05:48  |
Eclipse User |
|
|
|
Hello,
i want to inject a own Object (EMF Factory) in my part.
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
// Get Bundle Information
Bundle bundle = FrameworkUtil.getBundle(getClass());
IEclipseContext eclipseCtx =
EclipseContextFactory.getServiceContext(bundleContext);
eclipseCtx.set(MyFactory.class, MyFactory.eINSTANCE);
}
public class DetailPart {
@Inject
private MyFactory myFactory;
But it doesn't work
org.eclipse.e4.core.di.InjectionException: Unable to process "DetailPart.myFactory": no actual value was found for the argument "MyFactory".
Is the context wrong?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.50171 seconds