protected XtextResourceSet createFreshResourceSet(final ResourceDescriptionsData newIndex) { if ((this.resourceSet == null)) { this.resourceSet = this.createNewResourceSet(newIndex); } else { final ChunkedResourceDescriptions resDescs = ChunkedResourceDescriptions.findInEmfObject(this.resourceSet); Set<Map.Entry<String, ResourceDescriptionsData>> _entrySet = this.indexProvider.get().entrySet(); for (final Map.Entry<String, ResourceDescriptionsData> entry : _entrySet) { resDescs.setContainer(entry.getKey(), entry.getValue()); } resDescs.setContainer(this.projectDescription.getName(), newIndex); } return this.resourceSet; }
public IResourceDescriptions getIndex() { return new ChunkedResourceDescriptions(this.fullIndex); }
public XtextResourceSet createNewResourceSet(final ResourceDescriptionsData newIndex) { XtextResourceSet _get = this.resourceSetProvider.get(); final Procedure1<XtextResourceSet> _function = (XtextResourceSet it) -> { this.projectDescription.attachToEmfObject(it); ProjectConfigAdapter.install(it, this.projectConfig); Map<String, ResourceDescriptionsData> _get_1 = this.indexProvider.get(); final ChunkedResourceDescriptions index = new ChunkedResourceDescriptions(_get_1, it); index.setContainer(this.projectDescription.getName(), newIndex); this.externalContentSupport.configureResourceSet(it, this.openedDocumentsContentProvider); }; return ObjectExtensions.<XtextResourceSet>operator_doubleArrow(_get, _function); }
@Override protected void configure() { this.<Resource.Factory>bind(Resource.Factory.class).to(JavaResource.Factory.class); this.<IResourceValidator>bind(IResourceValidator.class).toInstance(IResourceValidator.NULL); this.<IGenerator>bind(IGenerator.class).to(IGenerator.NullGenerator.class); this.<IEncodingProvider>bind(IEncodingProvider.class).to(IEncodingProvider.Runtime.class); this.<IResourceServiceProvider>bind(IResourceServiceProvider.class).to(JavaResourceServiceProvider.class); this.<IContainer.Manager>bind(IContainer.Manager.class).to(SimpleResourceDescriptionsBasedContainerManager.class); this.<IResourceDescription.Manager>bind(IResourceDescription.Manager.class).to(JavaResourceDescriptionManager.class); this.<IQualifiedNameProvider>bind(IQualifiedNameProvider.class).to(JvmIdentifiableQualifiedNameProvider.class); this.<String>bind(String.class).annotatedWith(Names.named(Constants.FILE_EXTENSIONS)).toInstance("java"); this.<String>bind(String.class).annotatedWith(Names.named(Constants.LANGUAGE_NAME)).toInstance("org.eclipse.xtext.java.Java"); this.<IJvmTypeProvider.Factory>bind(IJvmTypeProvider.Factory.class).to(ClasspathTypeProviderFactory.class); this.<ClassLoader>bind(ClassLoader.class).toInstance(JavaSourceLanguageRuntimeModule.class.getClassLoader()); this.<IReferableElementsUnloader>bind(IReferableElementsUnloader.class).to(IReferableElementsUnloader.GenericUnloader.class); final IResourceDescriptionsProvider _function = (ResourceSet it) -> { return ChunkedResourceDescriptions.findInEmfObject(it); }; this.<IResourceDescriptionsProvider>bind(IResourceDescriptionsProvider.class).toInstance(_function); } }