| /** |
| * Copyright (c) 2017 CEA. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * CEA - initial API and implementation and/or initial documentation |
| */ |
| /* |
| * generated by Xtext 2.9.1 |
| */ |
| package org.eclipse.sensinact.studio.language; |
| |
| import com.google.inject.Guice; |
| import com.google.inject.Injector; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.resource.Resource; |
| import org.eclipse.sensinact.studio.language.sensinact.SensinactPackage; |
| import org.eclipse.xtext.ISetup; |
| import org.eclipse.xtext.common.TerminalsStandaloneSetup; |
| import org.eclipse.xtext.resource.IResourceFactory; |
| import org.eclipse.xtext.resource.IResourceServiceProvider; |
| |
| @SuppressWarnings("all") |
| public class SensinactStandaloneSetupGenerated implements ISetup { |
| |
| @Override |
| public Injector createInjectorAndDoEMFRegistration() { |
| TerminalsStandaloneSetup.doSetup(); |
| |
| Injector injector = createInjector(); |
| register(injector); |
| return injector; |
| } |
| |
| public Injector createInjector() { |
| return Guice.createInjector(new SensinactRuntimeModule()); |
| } |
| |
| public void register(Injector injector) { |
| if (!EPackage.Registry.INSTANCE.containsKey("http://www.eclipse.org/sensinact/studio/language/Sensinact")) { |
| EPackage.Registry.INSTANCE.put("http://www.eclipse.org/sensinact/studio/language/Sensinact", SensinactPackage.eINSTANCE); |
| } |
| IResourceFactory resourceFactory = injector.getInstance(IResourceFactory.class); |
| IResourceServiceProvider serviceProvider = injector.getInstance(IResourceServiceProvider.class); |
| |
| Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("sna", resourceFactory); |
| IResourceServiceProvider.Registry.INSTANCE.getExtensionToFactoryMap().put("sna", serviceProvider); |
| } |
| } |