Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-08-09 07:09:06 -0400
committerHenrik Rentz-Reichert2012-08-09 07:09:06 -0400
commit47eb607525f3b4648f84fb166dc6defa72777fbb (patch)
tree68360d2024da3ee8961fd715e4578830f9f00a08 /plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice
parent890a40b6b17e54c5b626c29fe03d145dc9272df5 (diff)
parent4fb92cefb480fde86d0892dba24271a36e8a77d1 (diff)
downloadorg.eclipse.etrice-47eb607525f3b4648f84fb166dc6defa72777fbb.tar.gz
org.eclipse.etrice-47eb607525f3b4648f84fb166dc6defa72777fbb.tar.xz
org.eclipse.etrice-47eb607525f3b4648f84fb166dc6defa72777fbb.zip
Merge remote branch 'refs/remotes/origin/juno'
Conflicts: features/org.eclipse.etrice.feature/feature.xml plugins/org.eclipse.etrice.core.config/META-INF/MANIFEST.MF plugins/org.eclipse.etrice.core.genmodel/model/etricegen.ecore plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ETriceGenPackage.java plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/ExpandedRefinedState.java plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ETriceGenPackageImpl.java plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedActorClassImpl.java plugins/org.eclipse.etrice.core.genmodel/src/org/eclipse/etrice/core/genmodel/etricegen/impl/ExpandedRefinedStateImpl.java plugins/org.eclipse.etrice.core.room.ui/src-gen/org/eclipse/etrice/core/ui/contentassist/antlr/internal/InternalRoom.g plugins/org.eclipse.etrice.core.room.ui/src-gen/org/eclipse/etrice/core/ui/contentassist/antlr/internal/InternalRoom.tokens plugins/org.eclipse.etrice.core.room.ui/src-gen/org/eclipse/etrice/core/ui/contentassist/antlr/internal/InternalRoomLexer.java plugins/org.eclipse.etrice.core.room.ui/src-gen/org/eclipse/etrice/core/ui/contentassist/antlr/internal/InternalRoomParser.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/Room.xmi plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/parseTreeConstruction/RoomParsetreeConstructor.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/parser/antlr/internal/InternalRoom.g plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/parser/antlr/internal/InternalRoom.tokens plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/parser/antlr/internal/InternalRoomLexer.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/parser/antlr/internal/InternalRoomParser.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/InSemanticsRule.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/OutSemanticsRule.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/RoomPackage.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/InSemanticsRuleImpl.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/room/impl/OutSemanticsRuleImpl.java plugins/org.eclipse.etrice.core.room/src-gen/org/eclipse/etrice/core/services/RoomGrammarAccess.java plugins/org.eclipse.etrice.core.room/src/org/eclipse/etrice/core/room/util/RoomHelpers.java plugins/org.eclipse.etrice.etunit.converter/src/org/eclipse/etrice/etunit/converter/EtUnitReportConverter.java plugins/org.eclipse.etrice.generator.c/src/org/eclipse/etrice/generator/c/gen/ActorClassGen.xtend plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ActorClassGen.java plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/CExtensions.java plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/DataClassGen.java plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/ProtocolClassGen.java plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/StateMachineGen.java plugins/org.eclipse.etrice.generator.c/xtend-gen/org/eclipse/etrice/generator/c/gen/SubSystemClassGen.java plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/ActorClassGen.xtend plugins/org.eclipse.etrice.generator.java/src/org/eclipse/etrice/generator/java/gen/DataClassGen.xtend plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ActorClassGen.java plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/DataClassGen.java plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/JavaExtensions.java plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/ProtocolClassGen.java plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/StateMachineGen.java plugins/org.eclipse.etrice.generator.java/xtend-gen/org/eclipse/etrice/generator/java/gen/SubSystemClassGen.java plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.xtend plugins/org.eclipse.etrice.generator/src/org/eclipse/etrice/generator/generic/ProcedureHelpers.xtend plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/GenericStateMachineGenerator.java plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/ProcedureHelpers.java plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/RoomExtensions.java plugins/org.eclipse.etrice.generator/xtend-gen/org/eclipse/etrice/generator/generic/TypeHelpers.java plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/dialogs/TransitionPropertyDialog.java plugins/org.eclipse.etrice.ui.behavior/src/org/eclipse/etrice/ui/behavior/support/SupportUtil.java plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.c.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.modellib.java.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.runtime.c.zip plugins/org.eclipse.etrice.ui.runtime/contents/org.eclipse.etrice.tutorials.zip tests/org.eclipse.etrice.core.config.tests/META-INF/MANIFEST.MF tests/org.eclipse.etrice.core.genmodel.tests/src/org/eclipse/etrice/core/genmodel/TestCodeInheritance.java tests/org.eclipse.etrice.integration.tests/generate.xml tests/org.eclipse.etrice.ui.behavior.tests/org.eclipse.etrice.ui.behavior.tests.launch tests/org.eclipse.etrice.ui.structure.tests/org.eclipse.etrice.ui.structure.tests.launch
Diffstat (limited to 'plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice')
-rw-r--r--plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/ConfigExecutableExtensionFactory.java56
-rw-r--r--plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/internal/ConfigActivator.java177
2 files changed, 124 insertions, 109 deletions
diff --git a/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/ConfigExecutableExtensionFactory.java b/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/ConfigExecutableExtensionFactory.java
index 492ef4f22..6695a3260 100644
--- a/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/ConfigExecutableExtensionFactory.java
+++ b/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/ConfigExecutableExtensionFactory.java
@@ -1,27 +1,29 @@
-/*
- * generated by Xtext
- */
-package org.eclipse.etrice.core.ui;
-
-import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory;
-import org.osgi.framework.Bundle;
-
-import com.google.inject.Injector;
-
-/**
- * This class was generated. Customizations should only happen in a newly
- * introduced subclass.
- */
-public class ConfigExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory {
-
- @Override
- protected Bundle getBundle() {
- return org.eclipse.etrice.core.ui.internal.ConfigActivator.getInstance().getBundle();
- }
-
- @Override
- protected Injector getInjector() {
- return org.eclipse.etrice.core.ui.internal.ConfigActivator.getInstance().getInjector("org.eclipse.etrice.core.Config");
- }
-
-}
+/*
+ * generated by Xtext
+ */
+package org.eclipse.etrice.core.ui;
+
+import org.eclipse.xtext.ui.guice.AbstractGuiceAwareExecutableExtensionFactory;
+import org.osgi.framework.Bundle;
+
+import com.google.inject.Injector;
+
+import org.eclipse.etrice.core.ui.internal.ConfigActivator;
+
+/**
+ * This class was generated. Customizations should only happen in a newly
+ * introduced subclass.
+ */
+public class ConfigExecutableExtensionFactory extends AbstractGuiceAwareExecutableExtensionFactory {
+
+ @Override
+ protected Bundle getBundle() {
+ return ConfigActivator.getInstance().getBundle();
+ }
+
+ @Override
+ protected Injector getInjector() {
+ return ConfigActivator.getInstance().getInjector(ConfigActivator.ORG_ECLIPSE_ETRICE_CORE_CONFIG);
+ }
+
+}
diff --git a/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/internal/ConfigActivator.java b/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/internal/ConfigActivator.java
index 6d008c213..be11391da 100644
--- a/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/internal/ConfigActivator.java
+++ b/plugins/org.eclipse.etrice.core.config.ui/src-gen/org/eclipse/etrice/core/ui/internal/ConfigActivator.java
@@ -1,82 +1,95 @@
-/*
- * generated by Xtext
- */
-package org.eclipse.etrice.core.ui.internal;
-
-import static com.google.inject.util.Modules.override;
-import static com.google.inject.Guice.createInjector;
-
-import org.apache.log4j.Logger;
-
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-import com.google.inject.Injector;
-import com.google.inject.Module;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * This class was generated. Customizations should only happen in a newly
- * introduced subclass.
- */
-public class ConfigActivator extends AbstractUIPlugin {
-
- private Map<String,Injector> injectors = new HashMap<String,Injector>();
- private static ConfigActivator INSTANCE;
-
- public Injector getInjector(String languageName) {
- return injectors.get(languageName);
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- try {
- registerInjectorFor("org.eclipse.etrice.core.Config");
-
- } catch (Exception e) {
- Logger.getLogger(getClass()).error(e.getMessage(), e);
- throw e;
- }
- }
-
- protected void registerInjectorFor(String language) throws Exception {
- injectors.put(language, createInjector(
- override(override(getRuntimeModule(language)).with(getSharedStateModule())).with(getUiModule(language))));
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- injectors.clear();
- INSTANCE = null;
- super.stop(context);
- }
-
- public static ConfigActivator getInstance() {
- return INSTANCE;
- }
-
- protected Module getRuntimeModule(String grammar) {
- if ("org.eclipse.etrice.core.Config".equals(grammar)) {
- return new org.eclipse.etrice.core.ConfigRuntimeModule();
- }
-
- throw new IllegalArgumentException(grammar);
- }
-
- protected Module getUiModule(String grammar) {
- if ("org.eclipse.etrice.core.Config".equals(grammar)) {
- return new org.eclipse.etrice.core.ui.ConfigUiModule(this);
- }
-
- throw new IllegalArgumentException(grammar);
- }
-
- protected Module getSharedStateModule() {
- return new org.eclipse.xtext.ui.shared.SharedStateModule();
- }
-
-}
+/*
+ * generated by Xtext
+ */
+package org.eclipse.etrice.core.ui.internal;
+
+import java.util.Collections;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.eclipse.xtext.ui.shared.SharedStateModule;
+import org.eclipse.xtext.util.Modules2;
+import org.osgi.framework.BundleContext;
+
+import com.google.common.collect.Maps;
+import com.google.inject.Guice;
+import com.google.inject.Injector;
+import com.google.inject.Module;
+
+/**
+ * This class was generated. Customizations should only happen in a newly
+ * introduced subclass.
+ */
+public class ConfigActivator extends AbstractUIPlugin {
+
+ public static final String ORG_ECLIPSE_ETRICE_CORE_CONFIG = "org.eclipse.etrice.core.Config";
+
+ private static final Logger logger = Logger.getLogger(ConfigActivator.class);
+
+ private static ConfigActivator INSTANCE;
+
+ private Map<String, Injector> injectors = Collections.synchronizedMap(Maps.<String, Injector> newHashMapWithExpectedSize(1));
+
+ @Override
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ INSTANCE = this;
+ }
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ injectors.clear();
+ INSTANCE = null;
+ super.stop(context);
+ }
+
+ public static ConfigActivator getInstance() {
+ return INSTANCE;
+ }
+
+ public Injector getInjector(String language) {
+ synchronized (injectors) {
+ Injector injector = injectors.get(language);
+ if (injector == null) {
+ injectors.put(language, injector = createInjector(language));
+ }
+ return injector;
+ }
+ }
+
+ protected Injector createInjector(String language) {
+ try {
+ Module runtimeModule = getRuntimeModule(language);
+ Module sharedStateModule = getSharedStateModule();
+ Module uiModule = getUiModule(language);
+ Module mergedModule = Modules2.mixin(runtimeModule, sharedStateModule, uiModule);
+ return Guice.createInjector(mergedModule);
+ } catch (Exception e) {
+ logger.error("Failed to create injector for " + language);
+ logger.error(e.getMessage(), e);
+ throw new RuntimeException("Failed to create injector for " + language, e);
+ }
+ }
+
+ protected Module getRuntimeModule(String grammar) {
+ if (ORG_ECLIPSE_ETRICE_CORE_CONFIG.equals(grammar)) {
+ return new org.eclipse.etrice.core.ConfigRuntimeModule();
+ }
+
+ throw new IllegalArgumentException(grammar);
+ }
+
+ protected Module getUiModule(String grammar) {
+ if (ORG_ECLIPSE_ETRICE_CORE_CONFIG.equals(grammar)) {
+ return new org.eclipse.etrice.core.ui.ConfigUiModule(this);
+ }
+
+ throw new IllegalArgumentException(grammar);
+ }
+
+ protected Module getSharedStateModule() {
+ return new SharedStateModule();
+ }
+
+}

Back to the top