Java Code Examples for org.eclipse.xtext.generator.AbstractFileSystemAccess

The following examples show how to use org.eclipse.xtext.generator.AbstractFileSystemAccess. These examples are extracted from open source projects. 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
@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
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 Project: joynr   Source File: FileSystemAccessUtil.java    License: 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 Project: joynr   Source File: AbstractGeneratorTest.java    License: 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;
    }