private IResourceServiceProvider.Registry loadRegistry() { final ResourceServiceProviderRegistryImpl registry = new ResourceServiceProviderRegistryImpl(); for (final ISetup cp : this.setupLoader) { { final Injector injector = cp.createInjectorAndDoEMFRegistration(); final IResourceServiceProvider resourceServiceProvider = injector.<IResourceServiceProvider>getInstance(IResourceServiceProvider.class); final FileExtensionProvider extensionProvider = injector.<FileExtensionProvider>getInstance(FileExtensionProvider.class); Set<String> _fileExtensions = extensionProvider.getFileExtensions(); for (final String ext : _fileExtensions) { boolean _containsKey = registry.getExtensionToFactoryMap().containsKey(ext); if (_containsKey) { String _primaryFileExtension = extensionProvider.getPrimaryFileExtension(); boolean _equals = Objects.equal(_primaryFileExtension, ext); if (_equals) { registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider); } } else { registry.getExtensionToFactoryMap().put(ext, resourceServiceProvider); } } } } return registry; }
protected ISetup lazyLinkingTestLangaugeSetup() { return new LazyLinkingTestLanguageStandaloneSetup() { @Override public Injector createInjector() { return Guice.createInjector(new org.eclipse.xtext.linking.lazy.LazyLinkingTestLanguageRuntimeModule() { @Override public void configureIResourceDescriptions(Binder binder) { binder.bind(org.eclipse.xtext.resource.IResourceDescriptions.class).to( ProxyfyingResourceDecriptions.class); } @Override public Class<? extends IGlobalScopeProvider> bindIGlobalScopeProvider() { return org.eclipse.xtext.scoping.impl.DefaultGlobalScopeProvider.class; } }); } }; }
protected ISetup doGetSetup() { return new ISetup() { public Injector createInjectorAndDoEMFRegistration() { return new EntitiesUiInjectorProvider().getInjector(); } }; }
/** * Registers a language initializer. */ public void addRegister(ISetup setup) { injectors.add(setup.createInjectorAndDoEMFRegistration()); }
/** * @return the delegate */ public ISetup getDelegate() { return delegate; }
/** * @param delegate the delegate to set */ @Mandatory public void setDelegate(ISetup delegate) { this.delegate = delegate; }
protected void with(Class<? extends ISetup> setupClazz) throws Exception { assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector); ISetup instance = setupClazz.newInstance(); setInjector(instance.createInjectorAndDoEMFRegistration()); }
public void with(ISetup setup) throws Exception { assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector); setInjector(setup.createInjectorAndDoEMFRegistration()); }
/** * Register a language setup. Only the first registered setup is used to inject the resource set. */ public void addRegister(ISetup setup) { injectors.add(setup.createInjectorAndDoEMFRegistration()); }
/** * registering an {@link ISetup}, which causes the execution of {@link ISetup#createInjectorAndDoEMFRegistration()} * the resulting {@link com.google.inject.Inject} is stored and used to obtain the used {@link IGenerator}. */ public void setRegister(ISetup setup) { injector = setup.createInjectorAndDoEMFRegistration(); }