Iterator<ModuleDefinition> singletons = core.getModuleRegistry().getModulesForType(DesignSourceModuleType.class).values().iterator();
while (singletons.hasNext()) {
ModuleDefinition sourceDefinition = singletons.next();
try {
sourceDefinition.testDependencies();
final DesignSourceProperties properties = (DesignSourceProperties) sourceDefinition.getProperties();
if (properties != null && properties.isSingleton()) {
try {
LocalizedInformation locInfo = new LocalizedInformation() {
public String getTitle(Locale locale) {
return properties.getSingletonTitle(locale);
}
public String getDescription(Locale locale) {
return properties.getSingletonDescription(locale);
}
};
WGADesignSource designSource = (WGADesignSource) core.getModuleRegistry().instantiate(sourceDefinition);
designSource.init(_core, properties.getSingletonUID(), locInfo, new HashMap<String,String>());
core.getLog().info("Registering design source '" + designSource.getTitle(Locale.getDefault()) + "' (Automatically created)");
_designSources.put(properties.getSingletonUID(), designSource);
}
catch (Exception e) {
core.getLog().error("Exception registering design source " + sourceDefinition.getTitle(Locale.getDefault()), e);
}
}