Search in sources :

Example 41 with IResourceFactory

use of org.eclipse.xtext.resource.IResourceFactory in project xtext-core by eclipse.

the class FileAwareTestLanguageStandaloneSetupGenerated method register.

public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/testlanguage/FileAware")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/testlanguage/FileAware", FileAwarePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("fileawaretestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("fileawaretestlanguage", serviceProvider);
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 42 with IResourceFactory

use of org.eclipse.xtext.resource.IResourceFactory in project xtext-core by eclipse.

the class BeeLangTestLanguageStandaloneSetupGenerated method register.

public void register(Injector injector) {
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2010/tmf/xtext/beeLangTestLanguage")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2010/tmf/xtext/beeLangTestLanguage", BeeLangTestLanguagePackage.eINSTANCE);
    }
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("beelangtestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("beelangtestlanguage", serviceProvider);
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 43 with IResourceFactory

use of org.eclipse.xtext.resource.IResourceFactory in project xtext-core by eclipse.

the class ExBeeLangTestLanguageStandaloneSetupGenerated method register.

public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("exbeelangtestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("exbeelangtestlanguage", serviceProvider);
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 44 with IResourceFactory

use of org.eclipse.xtext.resource.IResourceFactory in project xtext-core by eclipse.

the class SimpleBeeLangTestLanguageStandaloneSetupGenerated method register.

public void register(Injector injector) {
    IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
    Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("simplebeelangtestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("simplebeelangtestlanguage", serviceProvider);
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 45 with IResourceFactory

use of org.eclipse.xtext.resource.IResourceFactory in project xtext-core by eclipse.

the class WrappingInjectorProvider method registerFactory.

private void registerFactory(Injector injector) {
    IResourceFactory factory = injector.getInstance(IResourceFactory.class);
    IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class);
    FileExtensionProvider fileExtensionProvider = injector.getInstance(FileExtensionProvider.class);
    for (String ext : fileExtensionProvider.getFileExtensions()) {
        Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, factory);
        IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put(ext, serviceProvider);
    }
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) FileExtensionProvider(org.eclipse.xtext.resource.FileExtensionProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Aggregations

IResourceFactory (org.eclipse.xtext.resource.IResourceFactory)121 IResourceServiceProvider (org.eclipse.xtext.resource.IResourceServiceProvider)119 Injector (com.google.inject.Injector)2 Binder (com.google.inject.Binder)1 Resource (org.eclipse.emf.ecore.resource.Resource)1 WorkflowContextDefaultImpl (org.eclipse.emf.mwe.core.WorkflowContextDefaultImpl)1 IssuesImpl (org.eclipse.emf.mwe.core.issues.IssuesImpl)1 NullProgressMonitor (org.eclipse.emf.mwe.core.monitor.NullProgressMonitor)1 Grammar (org.eclipse.xtext.Grammar)1 XtextStandaloneSetup (org.eclipse.xtext.XtextStandaloneSetup)1 FileExtensionProvider (org.eclipse.xtext.resource.FileExtensionProvider)1 XtextResource (org.eclipse.xtext.resource.XtextResource)1 Test (org.junit.Test)1