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