Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementInitializers.xpt7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementInitializers.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementInitializers.xpt
index 622e42d3f..4a5ee0935 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementInitializers.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementInitializers.xpt
@@ -75,7 +75,13 @@ public class ElementInitializers {
«DEFINE performInit(GenCommonBase diagramElement, String instanceVar, GenClass instanceClass, List[int] counters) FOR GenFeatureInitializer»«ENDDEFINE»
+«REM»
+ FIXME: need cleaner appoach to provider's language switch (not to mix if == literal and polymorphism)
+«ENDREM»
«DEFINE performInit(GenCommonBase diagramElement, String instanceVar, GenClass instanceClass, List[int] counters) FOR GenFeatureValueSpec-»
+«IF value.provider.getLanguage() == GenLanguage::literal-»
+ «EXPAND MetaModel::modifyFeature(instanceVar, instanceClass, value.body) FOR feature»
+«ELSE-»
«LET getVariableName("value", counters) AS expressionVarName-»
Object «expressionVarName» = «EXPAND evaluateExpr(diagramElement, this, instanceVar) FOR value.provider»;
«IF isListType(feature)-»
@@ -102,6 +108,7 @@ public class ElementInitializers {
«EXPAND MetaModel::setFeatureValue(instanceVar, instanceClass, expressionVarName, true) FOR feature»;
«ENDIF /*isListType*/-»
«ENDLET-»
+«ENDIF /*is literal expression*/-»
«ENDDEFINE»
«DEFINE performInit(GenCommonBase diagramElement, String instanceVar, GenClass instanceClass, List[int] counters) FOR GenReferenceNewElementSpec-»

Back to the top