use of org.eclipse.xtext.resource.FileExtensionProvider in project smarthome by eclipse.
the class RegistryProvider method register.
private void register(IResourceServiceProvider.Registry registry, Injector injector) {
IResourceServiceProvider resourceServiceProvider = injector.getInstance(IResourceServiceProvider.class);
FileExtensionProvider extensionProvider = injector.getInstance(FileExtensionProvider.class);
for (String ext : extensionProvider.getFileExtensions()) {
if (registry.getExtensionToFactoryMap().containsKey(ext)) {
if (extensionProvider.getPrimaryFileExtension() == ext) {
registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider);
}
} else {
registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider);
}
IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, resourceFactory);
}
}
Aggregations