Search in sources :

Example 61 with IResourceFactory

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

the class SimpleExpressionsTestLanguageStandaloneSetupGenerated 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("simpleexpressionstestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("simpleexpressionstestlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/xtext/test/simpleExpressions")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/xtext/test/simpleExpressions", SimpleExpressionsPackage.eINSTANCE);
    }
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 62 with IResourceFactory

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

the class TestLanguageStandaloneSetupGenerated 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("testlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("testlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2008/xtext/TestLang")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2008/xtext/TestLang", TestLangPackage.eINSTANCE);
    }
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 63 with IResourceFactory

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

the class XtendStandaloneSetupGenerated 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("xtend", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("xtend", serviceProvider);
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 64 with IResourceFactory

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

the class HiddenTokenSequencerTestLanguageStandaloneSetupGenerated 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("hiddentokensequencertestlanguage", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("hiddentokensequencertestlanguage", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/2009/tmf/xtext/hiddentokensequencertestlanguage")) {
        EPackage.Registry.INSTANCE.put("http://www.eclipse.org/2009/tmf/xtext/hiddentokensequencertestlanguage", HiddentokensequencertestPackage.eINSTANCE);
    }
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) IResourceFactory(org.eclipse.xtext.resource.IResourceFactory)

Example 65 with IResourceFactory

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

the class Bug305397StandaloneSetupGenerated 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("bug305397", resourceFactory);
    IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("bug305397", serviceProvider);
    if (!EPackage.Registry.INSTANCE.containsKey("http://www.xtext.org/tests/bug305397")) {
        EPackage.Registry.INSTANCE.put("http://www.xtext.org/tests/bug305397", Bug305397Package.eINSTANCE);
    }
}
Also used : IResourceServiceProvider(org.eclipse.xtext.resource.IResourceServiceProvider) 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