/mdt-ocl-3.0.0/org.eclipse.ocl.examples.xtext.oclstdlib.ui/src-gen/org/eclipse/ocl/examples/xtext/oclstdlib/ui/internal/OCLstdlibActivator.java
# · Java · 73 lines · 48 code · 19 blank · 6 comment · 2 complexity · 924083505bd838b8d43fe8f5ac7e030f MD5 · raw file
- /*
- * generated by Xtext
- */
- package org.eclipse.ocl.examples.xtext.oclstdlib.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 OCLstdlibActivator extends AbstractUIPlugin {
- private Map<String,Injector> injectors = new HashMap<String,Injector>();
- private static OCLstdlibActivator 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.ocl.examples.xtext.oclstdlib.OCLstdlib", Guice.createInjector(
- Modules.override(Modules.override(getRuntimeModule("org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlib")).with(getUiModule("org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlib"))).with(getSharedStateModule())
- ));
-
- } catch (Exception e) {
- Logger.getLogger(getClass()).error(e.getMessage(), e);
- throw e;
- }
- }
-
- public static OCLstdlibActivator getInstance() {
- return INSTANCE;
- }
-
- protected Module getRuntimeModule(String grammar) {
-
- if ("org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlib".equals(grammar)) {
- return new org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlibRuntimeModule();
- }
-
- throw new IllegalArgumentException(grammar);
- }
- protected Module getUiModule(String grammar) {
-
- if ("org.eclipse.ocl.examples.xtext.oclstdlib.OCLstdlib".equals(grammar)) {
- return new org.eclipse.ocl.examples.xtext.oclstdlib.ui.OCLstdlibUiModule(this);
- }
-
- throw new IllegalArgumentException(grammar);
- }
-
- protected Module getSharedStateModule() {
- return new org.eclipse.xtext.ui.shared.SharedStateModule();
- }
-
- }