blob: 737b51b9278e8cc48153d599a4fb14b83742d6a6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
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.stereotypeapplicationwithvsl.editor.xtext.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 StereotypeApplicationWithVSLActivator extends AbstractUIPlugin {
private Map<String,Injector> injectors = new HashMap<String,Injector>();
private static StereotypeApplicationWithVSLActivator 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.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSL", Guice.createInjector(
Modules.override(Modules.override(getRuntimeModule("org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSL")).with(getUiModule("org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSL"))).with(getSharedStateModule())
));
} catch (Exception e) {
Logger.getLogger(getClass()).error(e.getMessage(), e);
throw e;
}
}
public static StereotypeApplicationWithVSLActivator getInstance() {
return INSTANCE;
}
protected Module getRuntimeModule(String grammar) {
if ("org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSL".equals(grammar)) {
return new org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSLRuntimeModule();
}
throw new IllegalArgumentException(grammar);
}
protected Module getUiModule(String grammar) {
if ("org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.StereotypeApplicationWithVSL".equals(grammar)) {
return new org.eclipse.papyrus.stereotypeapplicationwithvsl.editor.xtext.ui.StereotypeApplicationWithVSLUiModule(this);
}
throw new IllegalArgumentException(grammar);
}
protected Module getSharedStateModule() {
return new org.eclipse.xtext.ui.shared.SharedStateModule();
}
}
|