Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2008-07-02 17:23:50 +0000
committeratikhomirov2008-07-02 17:23:50 +0000
commit624525135b71e4cec79e1ce2b69bb2aca09e2dd1 (patch)
tree8c0d8e9834ecd8ae35e0f29c55e142b46b2ee525 /plugins
parentf3909449c37f98e7ec35488f658d55a727178540 (diff)
downloadorg.eclipse.gmf-tooling-624525135b71e4cec79e1ce2b69bb2aca09e2dd1.tar.gz
org.eclipse.gmf-tooling-624525135b71e4cec79e1ce2b69bb2aca09e2dd1.tar.xz
org.eclipse.gmf-tooling-624525135b71e4cec79e1ce2b69bb2aca09e2dd1.zip
[227127] support literal values for feature initializers. step 4: do not generate abstract expression unless needed
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
index f9157abb3..38eaf1f12 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java
@@ -866,15 +866,17 @@ public class Generator extends GeneratorBase implements Runnable {
private void generateExpressionProviders() throws UnexpectedBehaviourException, InterruptedException {
GenExpressionProviderContainer providerContainer = myEditorGen.getExpressionProviders();
- doGenerateJavaClass(myEmitters.getAbstractExpressionEmitter(), providerContainer.getAbstractExpressionQualifiedClassName(), myDiagram);
+ boolean needAbstractExpression = false;
for (GenExpressionProviderBase nextProvider : providerContainer.getProviders()) {
if (nextProvider instanceof GenExpressionInterpreter) {
TextEmitter providerEmitter = null;
if (GenLanguage.OCL_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getOCLExpressionFactoryEmitter();
+ needAbstractExpression = true;
} else if (GenLanguage.REGEXP_LITERAL.equals(nextProvider.getLanguage())
|| GenLanguage.NREGEXP_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getRegexpExpressionFactoryEmitter();
+ needAbstractExpression = true;
}
GenExpressionInterpreter interpreter = (GenExpressionInterpreter) nextProvider;
if (providerEmitter != null) {
@@ -882,6 +884,10 @@ public class Generator extends GeneratorBase implements Runnable {
}
}
}
+ if (needAbstractExpression) {
+ // so that if there are only literal initializers, do not generate any extra class
+ doGenerateJavaClass(myEmitters.getAbstractExpressionEmitter(), providerContainer.getAbstractExpressionQualifiedClassName(), myDiagram);
+ }
}
private void generateModelAccessFacility() throws UnexpectedBehaviourException, InterruptedException {

Back to the top