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

The following examples show how to use org.eclipse.xtext.generator.AbstractFileSystemAccess2. 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
Source Project: xtext-extras   Source File: LanguageAccess.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private void configureFileSystemAccess(final File baseDir, AbstractFileSystemAccess2 fsa) {
	Set<OutputConfiguration> confsForFsa = Sets.newHashSet();
	Set<OutputConfiguration> pomOutputConfigs = getConfiguredOutputConfigs();
	if (pomOutputConfigs != null && !pomOutputConfigs.isEmpty()) {
		for (OutputConfiguration pomConfig : pomOutputConfigs) {
			if (getOutputConfigurationProvider().getOutputConfigurations().contains(pomConfig)) {
				confsForFsa.add(pomConfig);
			} else {
				LOG.warn("Output '" + pomConfig.getName() 
							+ "' is not configured in OutputConfigurationProvider. Used provider "
							+ getOutputConfigurationProvider().getClass().getName());
			}
		}
	}
	confsForFsa.addAll(getOutputConfigurationProvider().getOutputConfigurations());
	Map<String, OutputConfiguration> asMap = IterableExtensions.toMap(
			Iterables.transform(confsForFsa, new Function<OutputConfiguration, OutputConfiguration>() {

				@Override
				public OutputConfiguration apply(OutputConfiguration output) {
					output.setOutputDirectory(resolveToBaseDir(output.getOutputDirectory(), baseDir));
					for (SourceMapping sourceMapping : output.getSourceMappings()) {
						sourceMapping.setOutputDirectory(resolveToBaseDir(sourceMapping.getOutputDirectory(), baseDir));
					}
					return output;
				}
			}), new Function1<OutputConfiguration, String>() {
				@Override
				public String apply(final OutputConfiguration it) {
					return it.getName();
				}
			});
	fsa.setOutputConfigurations(asMap);
}
 
Example 2
Source Project: xtext-core   Source File: ResourceStorageFacade.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected AbstractFileSystemAccess2 getFileSystemAccess(StorageAwareResource resource) {
	AbstractFileSystemAccess2 fsa = fileSystemAccessProvider.get();
	fsa.setContext(resource);
	fsa.setOutputConfigurations(
			toMap(outputConfigurationProvider.getOutputConfigurations(resource), it -> it.getName()));
	return fsa;
}
 
Example 3
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return JavaIoFileSystemAccess.class;
}
 
Example 4
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return JavaIoFileSystemAccess.class;
}
 
Example 5
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return JavaIoFileSystemAccess.class;
}
 
Example 6
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {	
    return EclipseResourceFileSystemAccess2.class;	
}
 
Example 7
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return EclipseResourceFileSystemAccess2.class;
}
 
Example 8
Source Project: xtext-xtend   Source File: XtendUiModule.java    License: Eclipse Public License 2.0 4 votes vote down vote up
@Override
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return EclipseResourceFileSystemAccess2.class;
}
 
Example 9
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return JavaIoFileSystemAccess.class;
}
 
Example 10
Source Project: sarl   Source File: AbstractSARLUiModule.java    License: Apache License 2.0 4 votes vote down vote up
public Class<? extends AbstractFileSystemAccess2> bindAbstractFileSystemAccess2() {
	return ProjectRelativeFileSystemAccess.class;
}