Java 类org.eclipse.xtext.ISetup 实例源码

项目:xtext-core    文件:ResourceServiceProviderServiceLoader.java   
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;
}
项目:xtext-core    文件:LazyLinkingResourceTest.java   
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;
                }
            });
        }
    };
}
项目:packtpub-xtext-book-examples    文件:EntitiesContentAssistJavaTest.java   
protected ISetup doGetSetup() {
    return new ISetup() {
        public Injector createInjectorAndDoEMFRegistration() {
            return new EntitiesUiInjectorProvider().getInjector();
        }
    };
}
项目:n4js    文件:XcoreReader.java   
/**
 * Registers a language initializer.
 */
public void addRegister(ISetup setup) {
    injectors.add(setup.createInjectorAndDoEMFRegistration());
}
项目:n4js    文件:CachedSetup.java   
/**
 * @return the delegate
 */
public ISetup getDelegate() {
    return delegate;
}
项目:n4js    文件:CachedSetup.java   
/**
 * @param delegate the delegate to set
 */
@Mandatory
public void setDelegate(ISetup delegate) {
    this.delegate = delegate;
}
项目:xtext-extras    文件:AbstractXtextTests.java   
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());
}
项目:xtext-extras    文件:AbstractXtextTests.java   
public void with(ISetup setup) throws Exception {
    assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector);
    setInjector(setup.createInjectorAndDoEMFRegistration());
}
项目:xtext-core    文件:AbstractReader.java   
/**
 * 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());
}
项目:xtext-core    文件:AbstractXtextTests.java   
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());
}
项目:xtext-core    文件:AbstractXtextTests.java   
public void with(ISetup setup) throws Exception {
    assertTrue("super.setUp() has to be called before any injector is instantiated", canCreateInjector);
    setInjector(setup.createInjectorAndDoEMFRegistration());
}
项目:xtext-core    文件:GeneratorComponent.java   
/**
 * 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();
}