PageRenderTime 26ms CodeModel.GetById 16ms app.highlight 5ms RepoModel.GetById 2ms app.codeStats 0ms

/plugins/org.eclipselabs.spray.xtext/src/org/eclipselabs/spray/xtext/SprayStandaloneSetup.java

https://bitbucket.org/gcubar/eclipselabs.org-spray
Java | 30 lines | 20 code | 6 blank | 4 comment | 0 complexity | 2d795b77326d4d21ea8aa4c92df6bdcc MD5 | raw file
 1package org.eclipselabs.spray.xtext;
 2
 3import org.eclipse.emf.ecore.EPackage;
 4import org.eclipse.xtext.ecore.EcoreSupport;
 5import org.eclipselabs.spray.mm.spray.SprayPackage;
 6
 7import com.google.inject.Injector;
 8
 9/**
10 * Initialization support for running Xtext languages
11 * without equinox extension registry
12 */
13public class SprayStandaloneSetup extends SprayStandaloneSetupGenerated {
14
15    public static void doSetup() {
16        new SprayStandaloneSetup().createInjectorAndDoEMFRegistration();
17    }
18
19    @Override
20    public Injector createInjectorAndDoEMFRegistration() {
21        EPackage.Registry.INSTANCE.put(SprayPackage.eNS_URI, SprayPackage.eINSTANCE);
22        return super.createInjectorAndDoEMFRegistration();
23    }
24
25    @Override
26    public void register(Injector injector) {
27        super.register(injector);
28        new EcoreSupport().registerServices(true);
29    }
30}