summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schuetz2013-06-18 18:36:16 (EDT)
committer Thomas Schuetz2013-06-18 18:36:16 (EDT)
commitb9bf0826e37b956fbd2ba175b90c8ae785cf54df (patch)
tree4e5d20d295dcccbba75e3614a654c167ec160f40
parentd8e8e581557c6b5af76d241d3a3b6b5ba0151c94 (diff)
downloadorg.eclipse.etrice-b9bf0826e37b956fbd2ba175b90c8ae785cf54df.zip
org.eclipse.etrice-b9bf0826e37b956fbd2ba175b90c8ae785cf54df.tar.gz
org.eclipse.etrice-b9bf0826e37b956fbd2ba175b90c8ae785cf54df.tar.bz2
[core.etmap.ui] added code first template for etmap
-rw-r--r--examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap18
-rw-r--r--plugins/org.eclipse.etrice.core.etmap.ui/templates/readme.txt5
-rw-r--r--plugins/org.eclipse.etrice.core.etmap.ui/templates/templates.xml18
3 files changed, 32 insertions, 9 deletions
diff --git a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
index 2f79c42..637eb0f 100644
--- a/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
+++ b/examples/org.eclipse.etrice.tutorials.c/model/HelloWorld/HelloWorld.etmap
@@ -1,9 +1,9 @@
-MappingModel cgenRef {
- import RoomModel1.* from "HelloWorld.room"
- import PhysicalModel1.* from "HelloWorld.etphys"
- Mapping LogSys1 -> PhysSys1 {
- SubSystemMapping SubSysRef1 -> nodeRef1 {
- ThreadMapping defaultThread -> PhysicalThread1
- }
- }
-}
+MappingModel MappingModel1 {
+ import RoomModel1.* from "HelloWorld.room"
+ import PhysicalModel1.* from "HelloWorld.etphys"
+ Mapping LogSys1 -> PhysSys1 {
+ SubSystemMapping SubSysRef1 -> nodeRef1 {
+ ThreadMapping defaultThread -> PhysicalThread1
+ }
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.etrice.core.etmap.ui/templates/readme.txt b/plugins/org.eclipse.etrice.core.etmap.ui/templates/readme.txt
new file mode 100644
index 0000000..b31c7b9
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap.ui/templates/readme.txt
@@ -0,0 +1,5 @@
+http://www.eclipse.org/Xtext/documentation/latest/xtext.html#templates
+
+However, these templates will not be visible by default. To fix it, you have to manually edit the xml-file and insert an ID attribute for each template element.
+
+Use Ctrl-Shift-F to format the exported template file.
diff --git a/plugins/org.eclipse.etrice.core.etmap.ui/templates/templates.xml b/plugins/org.eclipse.etrice.core.etmap.ui/templates/templates.xml
new file mode 100644
index 0000000..072aec2
--- /dev/null
+++ b/plugins/org.eclipse.etrice.core.etmap.ui/templates/templates.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<templates>
+
+ <template autoinsert="true" context="org.eclipse.etrice.core.etmap.ETMap.MappingModel"
+ deleted="false" description="model skeleton" enabled="true" id="mapping_model"
+ name="MappingModel">MappingModel ${MappingModel1} {&#13;
+ import ${RoomModel1}.* from "${RoomModelFile1}.room"
+ import ${PhysicalModel1}.* from "${PhysicalModelFile1}.etphys"
+ Mapping ${LogSys1} -> ${PhysSys1} {
+ SubSystemMapping ${SubSysRef1} -> ${nodeRef1} {
+ ThreadMapping defaultThread -> ${PhysicalThread1}
+ }
+ }
+ ${cursor}
+}&#13;</template>
+
+
+</templates> \ No newline at end of file