public void setInitializationData(IConfigurationElement config,\r
String propertyName, Object data) throws CoreException {\r
String bundleSymbolicName = config.getContributor().getName();\r
- ApplicationContext appContext = ApplicationContextTracker\r
+ ApplicationContext applicationContext = ApplicationContextTracker\r
.getApplicationContext(bundleSymbolicName);\r
- if (appContext == null)\r
+ if (applicationContext == null)\r
throw new ArgeoException(\r
"Cannot find application context for bundle "\r
+ bundleSymbolicName);\r
throw new ArgeoException("Cannot find bean name for extension "\r
+ config);\r
\r
- this.bean = appContext.getBean(beanName);\r
+ if (!applicationContext.containsBean(beanName)) {\r
+ if (beanName.startsWith(bundleSymbolicName))\r
+ beanName = beanName.substring(bundleSymbolicName.length() + 1);\r
+ }\r
+\r
+ if (!applicationContext.containsBean(beanName))\r
+ throw new ArgeoException("No bean with name '" + beanName + "'");\r
+\r
+ this.bean = applicationContext.getBean(beanName);\r
if (this.bean instanceof IExecutableExtension) {\r
((IExecutableExtension) this.bean).setInitializationData(config,\r
propertyName, data);\r