Java Code Examples for org.eclipse.xtext.resource.FileExtensionProvider#getPrimaryFileExtension()

The following examples show how to use org.eclipse.xtext.resource.FileExtensionProvider#getPrimaryFileExtension() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RegistryProvider.java    From openhab-core with Eclipse Public License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 2
Source File: RegistryProvider.java    From smarthome with Eclipse Public License 2.0 6 votes vote down vote up
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);
    }
}
 
Example 3
Source File: AbstractOutlineTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 4
Source File: ResourceHelper.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 5
Source File: ParseHelper.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * @since 2.5
 */
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 6
Source File: AbstractOutlineTest.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 7
Source File: ResourceHelper.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 8
Source File: ParseHelper.java    From xtext-core with Eclipse Public License 2.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}
 
Example 9
Source File: AbstractOutlineWorkbenchTest.java    From xsemantics with Eclipse Public License 1.0 4 votes vote down vote up
@Inject
public void setFileExtensionProvider(FileExtensionProvider extensionProvider) {
	fileExtension = extensionProvider.getPrimaryFileExtension();
}