Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2008-07-02 16:47:45 +0000
committeratikhomirov2008-07-02 16:47:45 +0000
commitf3909449c37f98e7ec35488f658d55a727178540 (patch)
tree1fd85b7209686b2ca0c47b3215f6e1d1e95ac539 /plugins
parent45de1a34eb19918b8492442a432eecf61ad96586 (diff)
downloadorg.eclipse.gmf-tooling-f3909449c37f98e7ec35488f658d55a727178540.tar.gz
org.eclipse.gmf-tooling-f3909449c37f98e7ec35488f658d55a727178540.tar.xz
org.eclipse.gmf-tooling-f3909449c37f98e7ec35488f658d55a727178540.zip
[227127] support literal values for feature initializers. step 3: respect literal expressions during map->gen transform, tests.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java b/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java
index 4af7e5319..be0397e44 100644
--- a/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java
+++ b/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java
@@ -818,6 +818,8 @@ public class DiagramGenModelTransformer extends MappingTransformer {
return GenLanguage.REGEXP_LITERAL;
case Language.NREGEXP:
return GenLanguage.NREGEXP_LITERAL;
+ case Language.LITERAL :
+ return GenLanguage.LITERAL_LITERAL;
default:
assert false : mapLang;
}
@@ -1065,23 +1067,24 @@ public class DiagramGenModelTransformer extends MappingTransformer {
}
private GenExpressionProviderBase createExpressionProvider(GenLanguage language) {
- GenExpressionProviderBase newProvider = null;
- if(GenLanguage.JAVA_LITERAL.equals(language)) {
- newProvider = GMFGenFactory.eINSTANCE.createGenJavaExpressionProvider();
- } else if(GenLanguage.OCL_LITERAL.equals(language)) {
- GenExpressionInterpreter oclProvider = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
- oclProvider.setLanguage(language);
- newProvider = oclProvider;
- } else if(GenLanguage.REGEXP_LITERAL.equals(language) || GenLanguage.NREGEXP_LITERAL.equals(language)) {
+ switch (language.getValue()) {
+ case GenLanguage.JAVA :
+ return GMFGenFactory.eINSTANCE.createGenJavaExpressionProvider();
+ case GenLanguage.OCL :
+ case GenLanguage.REGEXP :
+ case GenLanguage.NREGEXP : {
GenExpressionInterpreter regexpProvider = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
regexpProvider.setLanguage(language);
- newProvider = regexpProvider;
- } else {
- newProvider = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
+ return regexpProvider;
+ }
+ case GenLanguage.LITERAL :
+ return GMFGenFactory.eINSTANCE.createGenLiteralExpressionProvider();
+ default : {
+ assert false : language;
+ return GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
// fake provider with no language set to fail validation (XXX perhaps, makes sense to add 'unrecognized' language?)
}
- assert newProvider != null;
- return newProvider;
+ }
}
private void addPreferencePages(GenDiagram diagram) {

Back to the top