org.eclipse.xtext.generator.AbstractFileSystemAccess Java Examples

The following examples show how to use org.eclipse.xtext.generator.AbstractFileSystemAccess. 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: StandaloneBuilderModule.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
@Override
protected void configure() {
	bind(IResourceDescriptions.class)
			.annotatedWith(named(ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE))
			.to(ResourceSetBasedResourceDescriptions.class);
	bind(IResourceDescriptions.class)
			.annotatedWith(named(ResourceDescriptionsProvider.LIVE_SCOPE))
			.to(ResourceSetBasedResourceDescriptions.class);
	bind(IResourceDescriptions.class)
			.annotatedWith(named(ResourceDescriptionsProvider.PERSISTED_DESCRIPTIONS))
			.to(ResourceSetBasedResourceDescriptions.class);
	bind(IResourceDescriptions.class).to(ResourceSetBasedResourceDescriptions.class);
	bind(IIssueHandler.class).to(this.bindIIssueHandler());
	bind(AbstractFileSystemAccess.class).to(this.bindJavaIoFileSystemAccess());
	bind(IJavaCompiler.class).to(this.bindIJavaCompiler());
	bind(IEncodingProvider.class).to(this.bindIEncodingProvider());
}
 
Example #2
Source File: ParallelFileSystemAccess.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void sendAsync(Procedure1<? super IFileSystemAccess2> procedure) {
	Runnable runnable = () -> {
		if (delegate instanceof EclipseResourceFileSystemAccess2) {
			((EclipseResourceFileSystemAccess2) delegate).setPostProcessor(fileCallback);
		}
		if (sourceFolder != null) {
			if (delegate instanceof AbstractFileSystemAccess) {
				((AbstractFileSystemAccess) delegate).setCurrentSource(sourceFolder);
			}
		}
		procedure.apply(delegate);
	};
	fileSystemAccessQueue.sendAsync(delta.getUri(), runnable);
}
 
Example #3
Source File: FileSystemAccessUtil.java    From joynr with Apache License 2.0 5 votes vote down vote up
public static void createFileSystemAccess(IFileSystemAccess fileSystemAccess, String outputDirectory) {

        if (!(fileSystemAccess instanceof AbstractFileSystemAccess)) {
            throw new IllegalStateException("Guice Module configuration wrong: IFileSystemAccess.class shall be binded to a sub type of org.eclipse.xtext.generator.AbstractFileSystemAccess");
        }
        ((AbstractFileSystemAccess) fileSystemAccess).setOutputPath(outputDirectory);
        ((AbstractFileSystemAccess) fileSystemAccess).getOutputConfigurations()
                                                     .get(IFileSystemAccess.DEFAULT_OUTPUT)
                                                     .setCreateOutputDirectory(true);
    }
 
Example #4
Source File: AbstractGeneratorTest.java    From joynr with Apache License 2.0 5 votes vote down vote up
protected IFileSystemAccess createFileSystemAccess(String outputDirectory) {

        assertTrue(fileSystemAccess instanceof AbstractFileSystemAccess);
        ((AbstractFileSystemAccess) fileSystemAccess).setOutputPath(outputDirectory);
        ((AbstractFileSystemAccess) fileSystemAccess).getOutputConfigurations()
                                                     .get(IFileSystemAccess.DEFAULT_OUTPUT)
                                                     .setCreateOutputDirectory(true);
        return fileSystemAccess;
    }