Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2012-11-19 10:55:58 +0000
committerHenrik Rentz-Reichert2012-11-19 10:55:58 +0000
commit0cec37f413e05c519e04dc4c7ee7b5aea28944e6 (patch)
tree56ddcf2cf1ea3dccd3fbbce9f96373a579216d88 /plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice
parent8f612da204c23e5dee1918890444238fb2dd10e1 (diff)
downloadorg.eclipse.etrice-0cec37f413e05c519e04dc4c7ee7b5aea28944e6.tar.gz
org.eclipse.etrice-0cec37f413e05c519e04dc4c7ee7b5aea28944e6.tar.xz
org.eclipse.etrice-0cec37f413e05c519e04dc4c7ee7b5aea28944e6.zip
[generator, generator.config] added possibility to load referenced models
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice')
-rw-r--r--plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend20
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend b/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
index df5949be2..e7b0e7588 100644
--- a/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
+++ b/plugins/org.eclipse.etrice.generator.config/src/org/eclipse/etrice/generator/config/DataConfiguration.xtend
@@ -31,9 +31,18 @@ import org.eclipse.etrice.core.config.StringLiteral
import org.eclipse.etrice.core.config.LiteralArray
import org.eclipse.etrice.core.config.Literal
import org.eclipse.etrice.core.room.InterfaceItem
+import org.eclipse.emf.ecore.resource.Resource
+import org.eclipse.etrice.core.config.ConfigModel
+import com.google.inject.Inject
+import org.eclipse.xtext.scoping.impl.ImportUriResolver
class DataConfiguration implements IDataConfiguration {
+ @Inject
+ protected ILogger logger;
+
+ @Inject
+ protected ImportUriResolver uriResolver;
override doSetup() {
ConfigStandaloneSetup::doSetup()
@@ -157,4 +166,15 @@ class DataConfiguration implements IDataConfiguration {
return result
}
+ override addReferencedModels(Resource resource, List<String> uriList) {
+ val root = resource.contents.get(0)
+ if (root instanceof ConfigModel) {
+ for (imp : (root as ConfigModel).imports) {
+ val importURI = uriResolver.resolve(imp)
+ logger.logInfo("adding imported model "+importURI)
+ uriList.add(importURI)
+ }
+ }
+ }
+
} \ No newline at end of file

Back to the top