use of org.eclipse.xtext.resource.containers.DelegatingIAllContainerAdapter in project xtext-core by eclipse.
the class RuntimeResourceSetInitializer method getInitializedResourceSet.
public ResourceSet getInitializedResourceSet(List<String> pathes, UriFilter filter) {
ResourceSet resourceSet = resourceSetProvider.get();
Multimap<String, URI> pathToUriMap = getPathToUriMap(pathes, filter);
IAllContainersState containersState = factory.getContainersState(pathes, pathToUriMap);
resourceSet.eAdapters().add(new DelegatingIAllContainerAdapter(containersState));
for (URI uri : pathToUriMap.values()) {
resourceSet.createResource(uri);
}
return resourceSet;
}
use of org.eclipse.xtext.resource.containers.DelegatingIAllContainerAdapter in project n4js by eclipse.
the class N4HeadlessCompiler method createResourceSet.
/**
* Creates the common resource set to use during compilation. Installs a light weight index.
*
* @return the resource set
*/
private ResourceSet createResourceSet() {
// TODO try to reuse code from IN4JSCore.createResourceSet
XtextResourceSet resourceSet = xtextResourceSetProvider.get();
resourceSet.setClasspathURIContext(classLoader);
// Install containerState as adapter.
resourceSet.eAdapters().add(new DelegatingIAllContainerAdapter(rsbAcs));
// Install a lightweight index.
OrderedResourceDescriptionsData index = new OrderedResourceDescriptionsData(Collections.emptyList());
ResourceDescriptionsData.ResourceSetAdapter.installResourceDescriptionsData(resourceSet, index);
return resourceSet;
}
use of org.eclipse.xtext.resource.containers.DelegatingIAllContainerAdapter in project xtext-eclipse by eclipse.
the class PersistableResourceDescriptionsTest method createResourceSet.
public ResourceSet createResourceSet() {
ResourceSetImpl resourceSetImpl = new ResourceSetImpl();
resourceSetImpl.setURIConverter(uriConverter);
resourceSetImpl.eAdapters().add(new DelegatingIAllContainerAdapter(new IAllContainersState() {
@Override
public List<String> getVisibleContainerHandles(String handle) {
return null;
}
@Override
public Collection<URI> getContainedURIs(String containerHandle) {
return null;
}
@Override
public String getContainerHandle(URI uri) {
return null;
}
@Override
public boolean isEmpty(String containerHandle) {
return true;
}
}));
return resourceSetImpl;
}
Aggregations