diff options
author | 2019-08-01 14:49:53 +0200 | |
---|---|---|
committer | 2019-08-01 14:49:53 +0200 | |
commit | 972baab642bd889d2c3476c0c9e17a6929e0c318 (patch) | |
tree | 8f724cb348c60e4fc45d446d8532988ed8e40748 /Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java | |
parent | Counting scope propagator (simpler than BasicTypeHierarchy) (diff) | |
download | VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.gz VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.tar.zst VIATRA-Generator-972baab642bd889d2c3476c0c9e17a6929e0c318.zip |
[Stochastic] Remove fault tree support for now
Diffstat (limited to 'Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java')
-rw-r--r-- | Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java b/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java deleted file mode 100644 index 3b4702dd..00000000 --- a/Stochastic/hu.bme.mit.inf.dslreasoner.faulttree.components.ui/src-gen/hu/bme/mit/inf/dslreasoner/faulttree/components/ui/internal/ComponentsActivator.java +++ /dev/null | |||
@@ -1,94 +0,0 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.16.0 | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.faulttree.components.ui.internal; | ||
5 | |||
6 | import com.google.common.collect.Maps; | ||
7 | import com.google.inject.Guice; | ||
8 | import com.google.inject.Injector; | ||
9 | import hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguageRuntimeModule; | ||
10 | import hu.bme.mit.inf.dslreasoner.faulttree.components.ui.CftLanguageUiModule; | ||
11 | import java.util.Collections; | ||
12 | import java.util.Map; | ||
13 | import org.apache.log4j.Logger; | ||
14 | import org.eclipse.ui.plugin.AbstractUIPlugin; | ||
15 | import org.eclipse.xtext.ui.shared.SharedStateModule; | ||
16 | import org.eclipse.xtext.util.Modules2; | ||
17 | import org.osgi.framework.BundleContext; | ||
18 | |||
19 | /** | ||
20 | * This class was generated. Customizations should only happen in a newly | ||
21 | * introduced subclass. | ||
22 | */ | ||
23 | public class ComponentsActivator extends AbstractUIPlugin { | ||
24 | |||
25 | public static final String PLUGIN_ID = "hu.bme.mit.inf.dslreasoner.faulttree.components.ui"; | ||
26 | public static final String HU_BME_MIT_INF_DSLREASONER_FAULTTREE_COMPONENTS_CFTLANGUAGE = "hu.bme.mit.inf.dslreasoner.faulttree.components.CftLanguage"; | ||
27 | |||
28 | private static final Logger logger = Logger.getLogger(ComponentsActivator.class); | ||
29 | |||
30 | private static ComponentsActivator INSTANCE; | ||
31 | |||
32 | private Map<String, Injector> injectors = Collections.synchronizedMap(Maps.<String, Injector> newHashMapWithExpectedSize(1)); | ||
33 | |||
34 | @Override | ||
35 | public void start(BundleContext context) throws Exception { | ||
36 | super.start(context); | ||
37 | INSTANCE = this; | ||
38 | } | ||
39 | |||
40 | @Override | ||
41 | public void stop(BundleContext context) throws Exception { | ||
42 | injectors.clear(); | ||
43 | INSTANCE = null; | ||
44 | super.stop(context); | ||
45 | } | ||
46 | |||
47 | public static ComponentsActivator getInstance() { | ||
48 | return INSTANCE; | ||
49 | } | ||
50 | |||
51 | public Injector getInjector(String language) { | ||
52 | synchronized (injectors) { | ||
53 | Injector injector = injectors.get(language); | ||
54 | if (injector == null) { | ||
55 | injectors.put(language, injector = createInjector(language)); | ||
56 | } | ||
57 | return injector; | ||
58 | } | ||
59 | } | ||
60 | |||
61 | protected Injector createInjector(String language) { | ||
62 | try { | ||
63 | com.google.inject.Module runtimeModule = getRuntimeModule(language); | ||
64 | com.google.inject.Module sharedStateModule = getSharedStateModule(); | ||
65 | com.google.inject.Module uiModule = getUiModule(language); | ||
66 | com.google.inject.Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule); | ||
67 | return Guice.createInjector(mergedModule); | ||
68 | } catch (Exception e) { | ||
69 | logger.error("Failed to create injector for " + language); | ||
70 | logger.error(e.getMessage(), e); | ||
71 | throw new RuntimeException("Failed to create injector for " + language, e); | ||
72 | } | ||
73 | } | ||
74 | |||
75 | protected com.google.inject.Module getRuntimeModule(String grammar) { | ||
76 | if (HU_BME_MIT_INF_DSLREASONER_FAULTTREE_COMPONENTS_CFTLANGUAGE.equals(grammar)) { | ||
77 | return new CftLanguageRuntimeModule(); | ||
78 | } | ||
79 | throw new IllegalArgumentException(grammar); | ||
80 | } | ||
81 | |||
82 | protected com.google.inject.Module getUiModule(String grammar) { | ||
83 | if (HU_BME_MIT_INF_DSLREASONER_FAULTTREE_COMPONENTS_CFTLANGUAGE.equals(grammar)) { | ||
84 | return new CftLanguageUiModule(this); | ||
85 | } | ||
86 | throw new IllegalArgumentException(grammar); | ||
87 | } | ||
88 | |||
89 | protected com.google.inject.Module getSharedStateModule() { | ||
90 | return new SharedStateModule(); | ||
91 | } | ||
92 | |||
93 | |||
94 | } | ||