/plugins/grooveclipse/org.grooveclipse.analyze.tracedsl/src-gen/org/grooveclipse/analyze/TraceDslStandaloneSetupGenerated.java

http://grooveclipse.googlecode.com/ · Java · 52 lines · 34 code · 14 blank · 4 comment · 4 complexity · 29b7cec6bb0c7e5f9e33b682dcb4f2f9 MD5 · raw file

  1. package org.grooveclipse.analyze;
  2. import org.eclipse.emf.ecore.EPackage;
  3. import org.eclipse.xtext.ISetup;
  4. import org.eclipse.emf.ecore.resource.Resource;
  5. import com.google.inject.Guice;
  6. import com.google.inject.Injector;
  7. /**
  8. * Generated from StandaloneSetup.xpt!
  9. */
  10. @SuppressWarnings("all")
  11. public class TraceDslStandaloneSetupGenerated implements ISetup {
  12. public Injector createInjectorAndDoEMFRegistration() {
  13. // register default ePackages
  14. if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("ecore"))
  15. Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
  16. "ecore", new org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl());
  17. if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
  18. Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
  19. "xmi", new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl());
  20. if (!EPackage.Registry.INSTANCE.containsKey(org.eclipse.xtext.XtextPackage.eNS_URI))
  21. EPackage.Registry.INSTANCE.put(org.eclipse.xtext.XtextPackage.eNS_URI, org.eclipse.xtext.XtextPackage.eINSTANCE);
  22. Injector injector = createInjector();
  23. register(injector);
  24. return injector;
  25. }
  26. public Injector createInjector() {
  27. return Guice.createInjector(new org.grooveclipse.analyze.TraceDslRuntimeModule());
  28. }
  29. public void register(Injector injector) {
  30. if (!EPackage.Registry.INSTANCE.containsKey("http://www.grooveclipse.org/analyze/TraceDsl")) {
  31. EPackage.Registry.INSTANCE.put("http://www.grooveclipse.org/analyze/TraceDsl", org.grooveclipse.analyze.traceDsl.TraceDslPackage.eINSTANCE);
  32. }
  33. org.eclipse.xtext.resource.IResourceFactory resourceFactory = injector.getInstance(org.eclipse.xtext.resource.IResourceFactory.class);
  34. org.eclipse.xtext.resource.IResourceServiceProvider serviceProvider = injector.getInstance(org.eclipse.xtext.resource.IResourceServiceProvider.class);
  35. Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("trace", resourceFactory);
  36. org.eclipse.xtext.resource.IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("trace", serviceProvider);
  37. }
  38. }