Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorglefur2009-10-12 20:54:30 +0000
committerglefur2009-10-12 20:54:30 +0000
commitbaad1574cd1af8ede751f98a3d208a72200241d0 (patch)
treec2df7dc95a656888c6eceb6c3ac56b04f28c2b1b /plugins/org.eclipse.emf.eef.codegen
parent50692de45eb2c1e298d3f081e6bb97e7d017640c (diff)
downloadorg.eclipse.eef-baad1574cd1af8ede751f98a3d208a72200241d0.tar.gz
org.eclipse.eef-baad1574cd1af8ede751f98a3d208a72200241d0.tar.xz
org.eclipse.eef-baad1574cd1af8ede751f98a3d208a72200241d0.zip
UPDATED: better format
Diffstat (limited to 'plugins/org.eclipse.emf.eef.codegen')
-rw-r--r--plugins/org.eclipse.emf.eef.codegen/build.acceleo28
-rw-r--r--plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/text/textControl.mtl16
-rw-r--r--plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/textarea/textareaControl.mtl9
3 files changed, 18 insertions, 35 deletions
diff --git a/plugins/org.eclipse.emf.eef.codegen/build.acceleo b/plugins/org.eclipse.emf.eef.codegen/build.acceleo
index 964f24693..072701e9c 100644
--- a/plugins/org.eclipse.emf.eef.codegen/build.acceleo
+++ b/plugins/org.eclipse.emf.eef.codegen/build.acceleo
@@ -11,20 +11,6 @@
<echo message="This file must be called with explicit targets" />
</target>
- <!-- ===================================================================== -->
- <!-- Steps to do during the compilation target <name>, after the compile -->
- <!-- but before jaring. Substitute "name" with the name of the compilation-->
- <!-- target, eg @dot -->
- <!-- Available parameters : -->
- <!-- source.foldern : n = 1 ... N, the source folders -->
- <!-- target.folder : where the results of the compilation go -->
- <!-- <name>.classpath : name = name of the compilation target. A -->
- <!-- reference to the classpath structure. -->
- <!-- ===================================================================== -->
- <target name="post.compile.@dot">
-
- </target>
-
<!-- ================================================================= -->
<!-- Steps to do after the target gather.bin.parts -->
<!-- Available parameters : -->
@@ -32,16 +18,10 @@
<!-- target.folder - destination folder -->
<!-- ================================================================= -->
<target name="post.gather.bin.parts">
- <echo message="Compiling mtl templates" />
- <eclipse.incrementalBuild project="org.eclipse.emf.eef.codegen" kind="full" />
- <echo message="Copying emtl compiled templates" />
- <echo>
- copy todir="${target.folder}"
- fileset dir="${build.result.folder}" includes="**/*.emtl"
- </echo>
- <copy todir="${target.folder}" verbose="true">
- <fileset dir="${build.result.folder}/bin/" includes="**/*.emtl"/>
- </copy>
+ <eclipse.incrementalBuild
+ project="org.eclipse.emf.eef.codegen"
+ kind="full" />
+ <copydir dest="${target.folder}" src="${basedir}/bin"></copydir>
</target>
</project>
diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/text/textControl.mtl b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/text/textControl.mtl
index 67eaf6b3d..51daba888 100644
--- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/text/textControl.mtl
+++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/text/textControl.mtl
@@ -19,22 +19,24 @@
[comment ===== Case : model = Attribute(1) - view = Text ===== /]
[template public liveUpdater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) overrides liveUpdater ? (editionElement.model.isAttributeSingle() and editionElement.representationName('Text'))]
if ([editionElement.metamodelGetter()/].equals(msg.getFeature()) && [view.viewIdentifier(pec)/] != null){
- if(msg.getNewValue()!=null){
+ if (msg.getNewValue() != null) {
[if (editionElement.model.oclAsType(ecore::EAttribute).isString())]
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/]((String)msg.getNewValue());
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/]((String)msg.getNewValue());
[elseif (editionElement.model.oclAsType(ecore::EAttribute).isInteger())]
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Integer)msg.getNewValue()).toString());
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Integer)msg.getNewValue()).toString());
[elseif (editionElement.model.oclAsType(ecore::EAttribute).isShort())]
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Short)msg.getNewValue()).toString());
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Short)msg.getNewValue()).toString());
[elseif (editionElement.model.oclAsType(ecore::EAttribute).isLong())]
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Long)msg.getNewValue()).toString());
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Long)msg.getNewValue()).toString());
[elseif (editionElement.model.oclAsType(ecore::EAttribute).isDouble())]
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Double)msg.getNewValue()).toString());
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](((Double)msg.getNewValue()).toString());
[else]
//FIXME invalid case in liveUpdater(), Case : model = Attribute(1) : [editionElement.model.name/] - view = Text
[/if]
}
- else{[view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/]("");}}
+ else
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/]("");
+ }
[/template]
[template public liveCommandUpdater(editionElement : PropertiesEditionElement, view : View, modelName : String) overrides liveCommandUpdater ? (editionElement.model.isAttributeSingle() and editionElement.representationName('Text') and not editionElement.model.derived)]
diff --git a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/textarea/textareaControl.mtl b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/textarea/textareaControl.mtl
index 3927c6f5e..52c2a2fea 100644
--- a/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/textarea/textareaControl.mtl
+++ b/plugins/org.eclipse.emf.eef.codegen/src/org/eclipse/emf/eef/codegen/widgets/impl/textarea/textareaControl.mtl
@@ -20,10 +20,11 @@
[template public liveUpdater(editionElement : PropertiesEditionElement, view : View, pec : PropertiesEditionComponent) overrides liveUpdater ? (editionElement.model.isAttributeSingle() and editionElement.representationName('Textarea'))]
[if (editionElement.model.oclAsType(ecore::EAttribute).isString())]
if ([editionElement.metamodelGetter()/].equals(msg.getFeature()) && [view.viewIdentifier(pec)/] != null){
- if(msg.getNewValue()!=null){
- [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](([editionElement.views->first().toJavaType().trim()/])msg.getNewValue());
- }
- else{[view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](([editionElement.views->first().toJavaType().trim()/])"");}}
+ if (msg.getNewValue() != null)
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](([editionElement.views->first().toJavaType().trim()/])msg.getNewValue());
+ else
+ [view.viewIdentifier(pec)/].[editionElement.views->first().viewPackageSetter()/](([editionElement.views->first().toJavaType().trim()/])"");
+ }
[else]
//FIXME invalid case in liveUpdater(), Case : model = Attribute(1) : [editionElement.model.name/] - view = Textarea
[/if]

Back to the top