/** * Gets the resource set. Note that not all sources must be part of the same resource set. * * @param storage2UriMapper * the storage2 uri mapper * @param uri * the uri * @return the resource set */ private ResourceSet getResourceSet(final IStorage2UriMapper storage2UriMapper, final URI uri) { Iterable<Pair<IStorage, IProject>> storages = storage2UriMapper.getStorages(uri); if (!Iterables.isEmpty(storages)) { IProject project = Iterables.get(storages, 0).getSecond(); XtextResourceSetProvider resourceSetProvider = this.serviceProviderRegistry.getResourceServiceProvider(uri).get(XtextResourceSetProvider.class); return resourceSetProvider.get(project); } return null; }
@Override public Class<? extends IResourceSetProvider> bindIResourceSetProvider() { if (Access.getJdtHelper().get().isJavaCoreAvailable()) { return XtextResourceSetProvider.class; } else { return SimpleResourceSetProvider.class; } }
public Class<? extends IResourceSetProvider> bindIResourceSetProvider() { if (Access.getJdtHelper().get().isJavaCoreAvailable()) { return XtextResourceSetProvider.class; } else { return SimpleResourceSetProvider.class; } }
@Override protected void configure() { bind(ToBeBuiltComputer.class).to(SadlToBeBuiltComputer.class); bind(ProjectClasspathChangeListener.class).asEagerSingleton(); bind(IStorage2UriMapper.class).to(IStorage2UriMapperJdtExtensions.class); bind(IStorage2UriMapperJdtExtensions.class).to(Storage2UriMapperJavaImpl.class); bind(IResourceSetProvider.class).to(XtextResourceSetProvider.class); // bind(TypeResourceUnloader.class).asEagerSingleton(); bind(JavaChangeQueueFiller.class).asEagerSingleton(); bind(StorageAwareTrace.class).to(JarEntryAwareTrace.class); bind(DefaultTraceURIConverter.class).to(DefaultUITraceURIConverter.class); }
private Module getStaticTestModule() { return new AbstractModule() { @Override protected void configure() { bind(IResourceSetProvider.class).to(XtextResourceSetProvider.class); } }; }
public Class<? extends IResourceSetProvider> bindIResourceSetProvider() { return XtextResourceSetProvider.class; }