diff options
Diffstat (limited to 'extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui/src-gen/org/eclipse/papyrus/marte/vsl/ui/internal/VSLActivator.java')
-rw-r--r-- | extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui/src-gen/org/eclipse/papyrus/marte/vsl/ui/internal/VSLActivator.java | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui/src-gen/org/eclipse/papyrus/marte/vsl/ui/internal/VSLActivator.java b/extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui/src-gen/org/eclipse/papyrus/marte/vsl/ui/internal/VSLActivator.java new file mode 100644 index 00000000000..104e9e8e07f --- /dev/null +++ b/extraplugins/marte/org.eclipse.papyrus.marte.vsl.ui/src-gen/org/eclipse/papyrus/marte/vsl/ui/internal/VSLActivator.java @@ -0,0 +1,83 @@ + +/***************************************************************************** + * Copyright (c) 2010 CEA LIST. + * + * + * 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 LIST - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.marte.vsl.ui.internal; + +import org.apache.log4j.Logger; + +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Module; +import com.google.inject.util.Modules; + +import java.util.Map; +import java.util.HashMap; + +/** + * Generated + */ +public class VSLActivator extends AbstractUIPlugin { + + private Map<String,Injector> injectors = new HashMap<String,Injector>(); + private static VSLActivator INSTANCE; + + public Injector getInjector(String languageName) { + return injectors.get(languageName); + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + INSTANCE = this; + try { + + injectors.put("org.eclipse.papyrus.marte.vsl.VSL", Guice.createInjector( + Modules.override(Modules.override(getRuntimeModule("org.eclipse.papyrus.marte.vsl.VSL")).with(getUiModule("org.eclipse.papyrus.marte.vsl.VSL"))).with(getSharedStateModule()) + )); + + } catch (Exception e) { + Logger.getLogger(getClass()).error(e.getMessage(), e); + throw e; + } + } + + public static VSLActivator getInstance() { + return INSTANCE; + } + + protected Module getRuntimeModule(String grammar) { + + if ("org.eclipse.papyrus.marte.vsl.VSL".equals(grammar)) { + return new org.eclipse.papyrus.marte.vsl.VSLRuntimeModule(); + } + + throw new IllegalArgumentException(grammar); + } + protected Module getUiModule(String grammar) { + + if ("org.eclipse.papyrus.marte.vsl.VSL".equals(grammar)) { + return new org.eclipse.papyrus.marte.vsl.ui.VSLUiModule(this); + } + + throw new IllegalArgumentException(grammar); + } + + protected Module getSharedStateModule() { + return new org.eclipse.xtext.ui.shared.SharedStateModule(); + } + +} |