Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DiagramGenModelTransformer.java34
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/plugin.properties8
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenConstraintItemProvider.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenExpressionInterpreterItemProvider.java4
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenFeatureValueSpecItemProvider.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ValueExpressionItemProvider.java5
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/expressions/RegexpExpressionFactoryGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java5
-rw-r--r--plugins/org.eclipse.gmf.codegen.lite/templates/expressions/RegexpExpressionFactory.javajet2
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore18
-rw-r--r--plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel17
-rw-r--r--plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/expressions/RegexpExpressionFactoryGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java61
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionInterpreter.java13
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionProviderBase.java4
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLanguage.java205
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ValueExpression.java31
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java24
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java43
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionInterpreterImpl.java34
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionProviderBaseImpl.java5
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenJavaExpressionProviderImpl.java7
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/ValueExpressionImpl.java44
-rw-r--r--plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/util/Generator.java5
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/expressions/RegexpExpressionFactory.javajet2
25 files changed, 493 insertions, 86 deletions
diff --git a/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DiagramGenModelTransformer.java b/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DiagramGenModelTransformer.java
index 9f36f7265..aac0dd999 100644
--- a/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DiagramGenModelTransformer.java
+++ b/plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/bridge/genmodel/DiagramGenModelTransformer.java
@@ -57,6 +57,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
import org.eclipse.gmf.codegen.gmfgen.GenFeatureSeqInitializer;
import org.eclipse.gmf.codegen.gmfgen.GenFeatureValueSpec;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
import org.eclipse.gmf.codegen.gmfgen.GenLinkConstraints;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
@@ -104,6 +105,7 @@ import org.eclipse.gmf.mappings.ElementInitializer;
import org.eclipse.gmf.mappings.FeatureSeqInitializer;
import org.eclipse.gmf.mappings.FeatureValueSpec;
import org.eclipse.gmf.mappings.LabelMapping;
+import org.eclipse.gmf.mappings.Language;
import org.eclipse.gmf.mappings.LinkConstraints;
import org.eclipse.gmf.mappings.LinkMapping;
import org.eclipse.gmf.mappings.Mapping;
@@ -720,7 +722,7 @@ public class DiagramGenModelTransformer extends MappingTransformer {
GenFeatureValueSpec nextGenValSpec = GMFGenFactory.eINSTANCE.createGenFeatureValueSpec();
nextGenValSpec.setBody(nextValSpec.getBody());
- nextGenValSpec.setLanguage(nextValSpec.getLangName());
+ nextGenValSpec.setLanguage(createGenLanguage(nextValSpec.getLanguage()));
nextGenValSpec.setFeature(findGenFeature(nextValSpec.getFeature()));
bindToProvider(nextValSpec, nextGenValSpec);
@@ -732,13 +734,29 @@ public class DiagramGenModelTransformer extends MappingTransformer {
}
+ private static GenLanguage createGenLanguage(Language mapLang) {
+ switch (mapLang.getValue()) {
+ case Language.OCL:
+ return GenLanguage.OCL_LITERAL;
+ case Language.JAVA:
+ return GenLanguage.JAVA_LITERAL;
+ case Language.REGEXP:
+ return GenLanguage.REGEXP_LITERAL;
+ case Language.NREGEXP:
+ return GenLanguage.NREGEXP_LITERAL;
+ default:
+ assert false : mapLang;
+ }
+ return GenLanguage.OCL_LITERAL;
+ }
+
private GenConstraint createGenConstraint(Constraint constraint) {
if(constraint.getBody() == null) {
return null;
}
GenConstraint modelElementSelector = GMFGenFactory.eINSTANCE.createGenConstraint();
modelElementSelector.setBody(constraint.getBody());
- modelElementSelector.setLanguage(constraint.getLangName());
+ modelElementSelector.setLanguage(createGenLanguage(constraint.getLanguage()));
bindToProvider(constraint, modelElementSelector);
return modelElementSelector;
}
@@ -866,7 +884,7 @@ public class DiagramGenModelTransformer extends MappingTransformer {
if(metric.getRule() != null) {
ValueExpression valueExpression = GMFGenFactory.eINSTANCE.createValueExpression();
valueExpression.setBody(metric.getRule().getBody());
- valueExpression.setLanguage(metric.getRule().getLangName());
+ valueExpression.setLanguage(createGenLanguage(metric.getRule().getLanguage()));
bindToProvider(metric.getRule(), valueExpression);
genMetric.setRule(valueExpression);
}
@@ -886,7 +904,7 @@ public class DiagramGenModelTransformer extends MappingTransformer {
return;
}
- String language = genExpression.getLanguage();
+ GenLanguage language = genExpression.getLanguage();
if(language == null) {
return;
}
@@ -913,11 +931,11 @@ public class DiagramGenModelTransformer extends MappingTransformer {
provider.getExpressions().add(genExpression);
}
- private GenExpressionProviderBase createExpressionProvider(String language) {
+ private GenExpressionProviderBase createExpressionProvider(GenLanguage language) {
GenExpressionProviderBase newProvider = null;
- if("java".equals(language)) { //$NON-NLS-1$
+ if(GenLanguage.JAVA_LITERAL.equals(language)) {
newProvider = GMFGenFactory.eINSTANCE.createGenJavaExpressionProvider();
- } else if("ocl".equals(language)) { //$NON-NLS-1$
+ } else if(GenLanguage.OCL_LITERAL.equals(language)) {
GenExpressionInterpreter oclProvider = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
oclProvider.setLanguage(language);
oclProvider.getRequiredPluginIDs().addAll(Arrays.asList(new String[] {
@@ -925,7 +943,7 @@ public class DiagramGenModelTransformer extends MappingTransformer {
"org.eclipse.emf.query.ocl" //$NON-NLS-1$
}));
newProvider = oclProvider;
- } else if("regexp".equals(language) || "nregexp".equals(language)) { //$NON-NLS-1$ //$NON-NLS-2$
+ } else if(GenLanguage.REGEXP_LITERAL.equals(language) || GenLanguage.NREGEXP_LITERAL.equals(language)) {
GenExpressionInterpreter regexpProvider = GMFGenFactory.eINSTANCE.createGenExpressionInterpreter();
regexpProvider.setLanguage(language);
newProvider = regexpProvider;
diff --git a/plugins/org.eclipse.gmf.codegen.edit/plugin.properties b/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
index 4583ac9b4..34e209744 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
+++ b/plugins/org.eclipse.gmf.codegen.edit/plugin.properties
@@ -439,3 +439,11 @@ _UI_GenDomainAttributeTarget_attribute_feature = Attribute
_UI_ParentAssignedViewmap_getterName_feature = Accesor to parent figure's child
_UI_ParentAssignedViewmap_setterName_feature = Typed child.setFigure override
_UI_ParentAssignedViewmap_figureQualifiedClassName_feature = Figure Qualified Class Name
+# ====================================================================
+ _UI_ValueExpression_langName_feature = Lang Name
+_UI_GenLanguage_ocl_literal = ocl
+_UI_GenLanguage_java_literal = java
+_UI_GenLanguage_regexp_literal = regexp
+_UI_GenLanguage_nregexp_literal = nregexp
+
+
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenConstraintItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenConstraintItemProvider.java
index 08506ed37..b669056c3 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenConstraintItemProvider.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenConstraintItemProvider.java
@@ -80,7 +80,7 @@ public class GenConstraintItemProvider
* @generated
*/
public String getText(Object object) {
- String label = ((GenConstraint)object).getBody();
+ String label = crop(((GenConstraint)object).getBody());
return label == null || label.length() == 0 ?
getString("_UI_GenConstraint_type") :
getString("_UI_GenConstraint_type") + " " + label;
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenExpressionInterpreterItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenExpressionInterpreterItemProvider.java
index 91775914b..2612b5e15 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenExpressionInterpreterItemProvider.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenExpressionInterpreterItemProvider.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenExpressionInterpreterItemProvider.java,v 1.2 2006/05/17 14:22:36 dstadnik Exp $
+ * $Id: GenExpressionInterpreterItemProvider.java,v 1.3 2006/06/06 16:22:08 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen.provider;
@@ -128,7 +128,7 @@ public class GenExpressionInterpreterItemProvider
getString("_UI_GenExpressionInterpreter_language_feature"),
getString("_UI_PropertyDescriptor_description", "_UI_GenExpressionInterpreter_language_feature", "_UI_GenExpressionInterpreter_type"),
GMFGenPackage.eINSTANCE.getGenExpressionInterpreter_Language(),
- true,
+ false,
false,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenFeatureValueSpecItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenFeatureValueSpecItemProvider.java
index 58328c2e0..b9aec415e 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenFeatureValueSpecItemProvider.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/GenFeatureValueSpecItemProvider.java
@@ -101,7 +101,7 @@ public class GenFeatureValueSpecItemProvider
* @generated
*/
public String getText(Object object) {
- String label = ((GenFeatureValueSpec)object).getBody();
+ String label = crop(((GenFeatureValueSpec)object).getBody());
return label == null || label.length() == 0 ?
getString("_UI_GenFeatureValueSpec_type") :
getString("_UI_GenFeatureValueSpec_type") + " " + label;
diff --git a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ValueExpressionItemProvider.java b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ValueExpressionItemProvider.java
index 6f9fb4be5..edb3c44bb 100644
--- a/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ValueExpressionItemProvider.java
+++ b/plugins/org.eclipse.gmf.codegen.edit/src/org/eclipse/gmf/codegen/gmfgen/provider/ValueExpressionItemProvider.java
@@ -81,7 +81,7 @@ public class ValueExpressionItemProvider
getString("_UI_PropertyDescriptor_description", "_UI_ValueExpression_body_feature", "_UI_ValueExpression_type"),
GMFGenPackage.eINSTANCE.getValueExpression_Body(),
true,
- false,
+ true,
false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
null,
@@ -127,7 +127,7 @@ public class ValueExpressionItemProvider
* @generated
*/
public String getText(Object object) {
- String label = ((ValueExpression)object).getBody();
+ String label = crop(((ValueExpression)object).getBody());
return label == null || label.length() == 0 ?
getString("_UI_ValueExpression_type") :
getString("_UI_ValueExpression_type") + " " + label;
@@ -146,6 +146,7 @@ public class ValueExpressionItemProvider
switch (notification.getFeatureID(ValueExpression.class)) {
case GMFGenPackage.VALUE_EXPRESSION__BODY:
case GMFGenPackage.VALUE_EXPRESSION__LANGUAGE:
+ case GMFGenPackage.VALUE_EXPRESSION__LANG_NAME:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
}
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/expressions/RegexpExpressionFactoryGenerator.java b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/expressions/RegexpExpressionFactoryGenerator.java
index f6c294f33..97812ff0d 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/expressions/RegexpExpressionFactoryGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src-templates/org/eclipse/gmf/codegen/templates/lite/expressions/RegexpExpressionFactoryGenerator.java
@@ -37,7 +37,7 @@ final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]
final GenDiagram genDiagram = genInterpreter.getContainer().getEditorGen().getDiagram();
final String factoryClassName = genInterpreter.getClassName();
final String abstractExpressionClass = genInterpreter.getContainer().getAbstractExpressionQualifiedClassName();
-final boolean isNegationRegexp = !"regexp".equals(genInterpreter.getLanguage());
+final boolean isNegationRegexp = !GenLanguage.REGEXP_LITERAL.equals(genInterpreter.getLanguage());
stringBuffer.append(TEXT_1);
diff --git a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
index 71a8d4fde..cfd6b7051 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
+++ b/plugins/org.eclipse.gmf.codegen.lite/src/org/eclipse/gmf/internal/codegen/lite/Generator.java
@@ -32,6 +32,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
import org.eclipse.gmf.codegen.gmfgen.GenNode;
@@ -157,9 +158,9 @@ public class Generator extends GeneratorBase implements Runnable {
GenExpressionProviderBase nextProvider = (GenExpressionProviderBase) it.next();
if(nextProvider instanceof GenExpressionInterpreter) {
TextEmitter providerEmitter = null;
- if("ocl".equals(nextProvider.getLanguage())) { //$NON-NLS-1$
+ if(GenLanguage.OCL_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getOCLExpressionFactoryEmitter();
- } else if("regexp".equals(nextProvider.getLanguage()) || "nregexp".equals(nextProvider.getLanguage())) { //$NON-NLS-1$ //$NON-NLS-2$
+ } else if(GenLanguage.REGEXP_LITERAL.equals(nextProvider.getLanguage()) || GenLanguage.NREGEXP_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getRegexpExpressionFactoryEmitter();
}
GenExpressionInterpreter interpreter = (GenExpressionInterpreter)nextProvider;
diff --git a/plugins/org.eclipse.gmf.codegen.lite/templates/expressions/RegexpExpressionFactory.javajet b/plugins/org.eclipse.gmf.codegen.lite/templates/expressions/RegexpExpressionFactory.javajet
index 2e1df926c..29a406c7d 100644
--- a/plugins/org.eclipse.gmf.codegen.lite/templates/expressions/RegexpExpressionFactory.javajet
+++ b/plugins/org.eclipse.gmf.codegen.lite/templates/expressions/RegexpExpressionFactory.javajet
@@ -6,7 +6,7 @@ final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]
final GenDiagram genDiagram = genInterpreter.getContainer().getEditorGen().getDiagram();
final String factoryClassName = genInterpreter.getClassName();
final String abstractExpressionClass = genInterpreter.getContainer().getAbstractExpressionQualifiedClassName();
-final boolean isNegationRegexp = !"regexp".equals(genInterpreter.getLanguage());
+final boolean isNegationRegexp = !GenLanguage.REGEXP_LITERAL.equals(genInterpreter.getLanguage());
%>
<%@ include file="../copyright4java.jetinc"%>
<%importManager.emitPackageStatement(stringBuffer);%>
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
index a9c43e1fe..f35a4248e 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.ecore
@@ -883,11 +883,14 @@
<details key="def" value="body"/>
</eAnnotations>
</eStructuralFeatures>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="language" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
- defaultValueLiteral="ocl">
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="language" lowerBound="1"
+ eType="#//GenLanguage" defaultValueLiteral="ocl">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="Specifies the language in which the expression is stated"/>
</eAnnotations>
+ </eStructuralFeatures>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="langName" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"
+ changeable="false" volatile="true" transient="true" derived="true">
<eAnnotations source="http://www.eclipse.org/gmf/2005/constraints/meta">
<details key="def" value="lang"/>
</eAnnotations>
@@ -1402,7 +1405,7 @@
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GenExpressionProviderBase" abstract="true">
<eOperations name="getRequiredPluginIDs" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eOperations name="getLanguage" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eOperations name="getLanguage" lowerBound="1" eType="#//GenLanguage"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="expressions" upperBound="-1"
eType="#//ValueExpression"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="container" lowerBound="1"
@@ -1418,9 +1421,16 @@
<eOperations name="getExpressionAccessor" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eParameters name="expression" lowerBound="1" eType="#//ValueExpression"/>
</eOperations>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="language" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="language" lowerBound="1"
+ eType="#//GenLanguage"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredPluginIDs" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EEnum" name="GenLanguage">
+ <eLiterals name="ocl"/>
+ <eLiterals name="java" value="1"/>
+ <eLiterals name="regexp" value="2"/>
+ <eLiterals name="nregexp" value="3"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
index de502f187..be78799ad 100644
--- a/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
+++ b/plugins/org.eclipse.gmf.codegen/models/gmfgen.genmodel
@@ -32,6 +32,12 @@
<genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenSeverity/WARNING"/>
<genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenSeverity/ERROR"/>
</genEnums>
+ <genEnums ecoreEnum="gmfgen.ecore#//GenLanguage">
+ <genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenLanguage/ocl"/>
+ <genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenLanguage/java"/>
+ <genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenLanguage/regexp"/>
+ <genEnumLiterals ecoreEnumLiteral="gmfgen.ecore#//GenLanguage/nregexp"/>
+ </genEnums>
<genClasses ecoreClass="gmfgen.ecore#//GenEditorGenerator">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenEditorGenerator/audits"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference gmfgen.ecore#//GenEditorGenerator/metrics"/>
@@ -384,11 +390,12 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ParentAssignedViewmap/setterName"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ParentAssignedViewmap/figureQualifiedClassName"/>
</genClasses>
- <genClasses ecoreClass="gmfgen.ecore#//ValueExpression">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ValueExpression/body"/>
+ <genClasses ecoreClass="gmfgen.ecore#//ValueExpression" labelFeature="#//gmfgen/ValueExpression/body">
+ <genFeatures createChild="false" propertyMultiLine="true" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ValueExpression/body"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ValueExpression/language"/>
+ <genFeatures property="None" createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//ValueExpression/langName"/>
</genClasses>
- <genClasses ecoreClass="gmfgen.ecore#//GenConstraint"/>
+ <genClasses ecoreClass="gmfgen.ecore#//GenConstraint" labelFeature="#//gmfgen/ValueExpression/body"/>
<genClasses ecoreClass="gmfgen.ecore#//Palette">
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//Palette/diagram"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//Palette/flyout"/>
@@ -428,7 +435,7 @@
<genOperations ecoreOperation="gmfgen.ecore#//GenFeatureSeqInitializer/getElementClassAccessorName"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenFeatureSeqInitializer/getElementQualifiedPackageInterfaceName"/>
</genClasses>
- <genClasses ecoreClass="gmfgen.ecore#//GenFeatureValueSpec">
+ <genClasses ecoreClass="gmfgen.ecore#//GenFeatureValueSpec" labelFeature="#//gmfgen/ValueExpression/body">
<genFeatures notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenFeatureValueSpec/feature"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference gmfgen.ecore#//GenFeatureValueSpec/featureSeqInitializer"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenFeatureValueSpec/getFeatureQualifiedPackageInterfaceName"/>
@@ -533,7 +540,7 @@
</genOperations>
</genClasses>
<genClasses ecoreClass="gmfgen.ecore#//GenExpressionInterpreter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenExpressionInterpreter/language"/>
+ <genFeatures property="Readonly" createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenExpressionInterpreter/language"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenExpressionInterpreter/className"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute gmfgen.ecore#//GenExpressionInterpreter/requiredPluginIDs"/>
<genOperations ecoreOperation="gmfgen.ecore#//GenExpressionInterpreter/getQualifiedClassName"/>
diff --git a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/expressions/RegexpExpressionFactoryGenerator.java b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/expressions/RegexpExpressionFactoryGenerator.java
index bf1169314..d7ed7beb9 100644
--- a/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/expressions/RegexpExpressionFactoryGenerator.java
+++ b/plugins/org.eclipse.gmf.codegen/src-templates/org/eclipse/gmf/codegen/templates/expressions/RegexpExpressionFactoryGenerator.java
@@ -37,7 +37,7 @@ final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]
final GenDiagram genDiagram = genInterpreter.getContainer().getEditorGen().getDiagram();
final String factoryClassName = genInterpreter.getClassName();
final String abstractExpressionClass = genInterpreter.getContainer().getAbstractExpressionQualifiedClassName();
-final boolean isNegationRegexp = !"regexp".equals(genInterpreter.getLanguage());
+final boolean isNegationRegexp = !GenLanguage.REGEXP_LITERAL.equals(genInterpreter.getLanguage());
stringBuffer.append(TEXT_1);
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
index 42fd33ee9..c45eb9568 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GMFGenPackage.java
@@ -4680,13 +4680,22 @@ public interface GMFGenPackage extends EPackage {
int VALUE_EXPRESSION__LANGUAGE = 1;
/**
+ * The feature id for the '<em><b>Lang Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int VALUE_EXPRESSION__LANG_NAME = 2;
+
+ /**
* The number of structural features of the '<em>Value Expression</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int VALUE_EXPRESSION_FEATURE_COUNT = 2;
+ int VALUE_EXPRESSION_FEATURE_COUNT = 3;
/**
* The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.impl.GenConstraintImpl <em>Gen Constraint</em>}' class.
@@ -4717,6 +4726,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_CONSTRAINT__LANGUAGE = VALUE_EXPRESSION__LANGUAGE;
/**
+ * The feature id for the '<em><b>Lang Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_CONSTRAINT__LANG_NAME = VALUE_EXPRESSION__LANG_NAME;
+
+ /**
* The number of structural features of the '<em>Gen Constraint</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -5163,6 +5181,15 @@ public interface GMFGenPackage extends EPackage {
int GEN_FEATURE_VALUE_SPEC__LANGUAGE = VALUE_EXPRESSION__LANGUAGE;
/**
+ * The feature id for the '<em><b>Lang Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ * @ordered
+ */
+ int GEN_FEATURE_VALUE_SPEC__LANG_NAME = VALUE_EXPRESSION__LANG_NAME;
+
+ /**
* The feature id for the '<em><b>Feature</b></em>' reference.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -6059,6 +6086,17 @@ public interface GMFGenPackage extends EPackage {
int GEN_SEVERITY = 82;
/**
+ * The meta object id for the '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage <em>Gen Language</em>}' enum.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
+ * @see org.eclipse.gmf.codegen.gmfgen.impl.GMFGenPackageImpl#getGenLanguage()
+ * @generated
+ */
+ int GEN_LANGUAGE = 83;
+
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator <em>Gen Editor Generator</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -8517,6 +8555,17 @@ public interface GMFGenPackage extends EPackage {
EAttribute getValueExpression_Language();
/**
+ * Returns the meta object for the attribute '{@link org.eclipse.gmf.codegen.gmfgen.ValueExpression#getLangName <em>Lang Name</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for the attribute '<em>Lang Name</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.ValueExpression#getLangName()
+ * @see #getValueExpression()
+ * @generated
+ */
+ EAttribute getValueExpression_LangName();
+
+ /**
* Returns the meta object for class '{@link org.eclipse.gmf.codegen.gmfgen.GenConstraint <em>Gen Constraint</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -9573,6 +9622,16 @@ public interface GMFGenPackage extends EPackage {
EEnum getGenSeverity();
/**
+ * Returns the meta object for enum '{@link org.eclipse.gmf.codegen.gmfgen.GenLanguage <em>Gen Language</em>}'.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @return the meta object for enum '<em>Gen Language</em>'.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
+ * @generated
+ */
+ EEnum getGenLanguage();
+
+ /**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionInterpreter.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionInterpreter.java
index 4c2d781d9..df7582ab8 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionInterpreter.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionInterpreter.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenExpressionInterpreter.java,v 1.1 2006/04/13 15:41:17 radvorak Exp $
+ * $Id: GenExpressionInterpreter.java,v 1.2 2006/06/06 16:22:23 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen;
@@ -71,6 +71,7 @@ public interface GenExpressionInterpreter extends GenExpressionProviderBase {
/**
* Returns the value of the '<em><b>Language</b></em>' attribute.
+ * The literals are from the enumeration {@link org.eclipse.gmf.codegen.gmfgen.GenLanguage}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Language</em>' attribute isn't clear,
@@ -78,22 +79,24 @@ public interface GenExpressionInterpreter extends GenExpressionProviderBase {
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Language</em>' attribute.
- * @see #setLanguage(String)
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
+ * @see #setLanguage(GenLanguage)
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenExpressionInterpreter_Language()
- * @model
+ * @model required="true"
* @generated
*/
- String getLanguage();
+ GenLanguage getLanguage();
/**
* Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter#getLanguage <em>Language</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Language</em>' attribute.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
* @see #getLanguage()
* @generated
*/
- void setLanguage(String value);
+ void setLanguage(GenLanguage value);
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionProviderBase.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionProviderBase.java
index 7330358d9..04ea28a9d 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionProviderBase.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenExpressionProviderBase.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenExpressionProviderBase.java,v 1.3 2006/05/24 16:22:37 radvorak Exp $
+ * $Id: GenExpressionProviderBase.java,v 1.4 2006/06/06 16:22:23 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen;
@@ -39,7 +39,7 @@ public interface GenExpressionProviderBase extends EObject {
* @model kind="operation" required="true"
* @generated
*/
- String getLanguage();
+ GenLanguage getLanguage();
/**
* Returns the value of the '<em><b>Expressions</b></em>' reference list.
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLanguage.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLanguage.java
new file mode 100644
index 000000000..113e1e911
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/GenLanguage.java
@@ -0,0 +1,205 @@
+/**
+ * <copyright>
+ * </copyright>
+ *
+ * $Id: GenLanguage.java,v 1.1 2006/06/06 16:22:23 radvorak Exp $
+ */
+package org.eclipse.gmf.codegen.gmfgen;
+
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import org.eclipse.emf.common.util.AbstractEnumerator;
+
+/**
+ * <!-- begin-user-doc -->
+ * A representation of the literals of the enumeration '<em><b>Gen Language</b></em>',
+ * and utility methods for working with them.
+ * <!-- end-user-doc -->
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getGenLanguage()
+ * @model
+ * @generated
+ */
+public final class GenLanguage extends AbstractEnumerator {
+ /**
+ * The '<em><b>Ocl</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Ocl</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #OCL_LITERAL
+ * @model name="ocl"
+ * @generated
+ * @ordered
+ */
+ public static final int OCL = 0;
+
+ /**
+ * The '<em><b>Java</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Java</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #JAVA_LITERAL
+ * @model name="java"
+ * @generated
+ * @ordered
+ */
+ public static final int JAVA = 1;
+
+ /**
+ * The '<em><b>Regexp</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Regexp</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #REGEXP_LITERAL
+ * @model name="regexp"
+ * @generated
+ * @ordered
+ */
+ public static final int REGEXP = 2;
+
+ /**
+ * The '<em><b>Nregexp</b></em>' literal value.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of '<em><b>Nregexp</b></em>' literal object isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @see #NREGEXP_LITERAL
+ * @model name="nregexp"
+ * @generated
+ * @ordered
+ */
+ public static final int NREGEXP = 3;
+
+ /**
+ * The '<em><b>Ocl</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #OCL
+ * @generated
+ * @ordered
+ */
+ public static final GenLanguage OCL_LITERAL = new GenLanguage(OCL, "ocl", "ocl");
+
+ /**
+ * The '<em><b>Java</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #JAVA
+ * @generated
+ * @ordered
+ */
+ public static final GenLanguage JAVA_LITERAL = new GenLanguage(JAVA, "java", "java");
+
+ /**
+ * The '<em><b>Regexp</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #REGEXP
+ * @generated
+ * @ordered
+ */
+ public static final GenLanguage REGEXP_LITERAL = new GenLanguage(REGEXP, "regexp", "regexp");
+
+ /**
+ * The '<em><b>Nregexp</b></em>' literal object.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #NREGEXP
+ * @generated
+ * @ordered
+ */
+ public static final GenLanguage NREGEXP_LITERAL = new GenLanguage(NREGEXP, "nregexp", "nregexp");
+
+ /**
+ * An array of all the '<em><b>Gen Language</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private static final GenLanguage[] VALUES_ARRAY =
+ new GenLanguage[] {
+ OCL_LITERAL,
+ JAVA_LITERAL,
+ REGEXP_LITERAL,
+ NREGEXP_LITERAL,
+ };
+
+ /**
+ * A public read-only list of all the '<em><b>Gen Language</b></em>' enumerators.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
+
+ /**
+ * Returns the '<em><b>Gen Language</b></em>' literal with the specified literal value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GenLanguage get(String literal) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ GenLanguage result = VALUES_ARRAY[i];
+ if (result.toString().equals(literal)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Gen Language</b></em>' literal with the specified name.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GenLanguage getByName(String name) {
+ for (int i = 0; i < VALUES_ARRAY.length; ++i) {
+ GenLanguage result = VALUES_ARRAY[i];
+ if (result.getName().equals(name)) {
+ return result;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Returns the '<em><b>Gen Language</b></em>' literal with the specified integer value.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public static GenLanguage get(int value) {
+ switch (value) {
+ case OCL: return OCL_LITERAL;
+ case JAVA: return JAVA_LITERAL;
+ case REGEXP: return REGEXP_LITERAL;
+ case NREGEXP: return NREGEXP_LITERAL;
+ }
+ return null;
+ }
+
+ /**
+ * Only this class can construct instances.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private GenLanguage(int value, String name, String literal) {
+ super(value, name, literal);
+ }
+
+} //GenLanguage
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ValueExpression.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ValueExpression.java
index 2c162a57b..bfbc48b30 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ValueExpression.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/ValueExpression.java
@@ -22,6 +22,7 @@ import org.eclipse.emf.ecore.EObject;
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.ValueExpression#getBody <em>Body</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.ValueExpression#getLanguage <em>Language</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.ValueExpression#getLangName <em>Lang Name</em>}</li>
* </ul>
* </p>
*
@@ -29,7 +30,7 @@ import org.eclipse.emf.ecore.EObject;
* @model annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='ValueSpec'"
* @generated
*/
-public interface ValueExpression extends EObject{
+public interface ValueExpression extends EObject {
/**
* Returns the value of the '<em><b>Body</b></em>' attribute.
* <!-- begin-user-doc -->
@@ -63,6 +64,7 @@ public interface ValueExpression extends EObject{
/**
* Returns the value of the '<em><b>Language</b></em>' attribute.
* The default value is <code>"ocl"</code>.
+ * The literals are from the enumeration {@link org.eclipse.gmf.codegen.gmfgen.GenLanguage}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Language</em>' attribute isn't clear,
@@ -73,23 +75,40 @@ public interface ValueExpression extends EObject{
* Specifies the language in which the expression is stated
* <!-- end-model-doc -->
* @return the value of the '<em>Language</em>' attribute.
- * @see #setLanguage(String)
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
+ * @see #setLanguage(GenLanguage)
* @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getValueExpression_Language()
- * @model default="ocl"
- * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='lang'"
+ * @model default="ocl" required="true"
* @generated
*/
- String getLanguage();
+ GenLanguage getLanguage();
/**
* Sets the value of the '{@link org.eclipse.gmf.codegen.gmfgen.ValueExpression#getLanguage <em>Language</em>}' attribute.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @param value the new value of the '<em>Language</em>' attribute.
+ * @see org.eclipse.gmf.codegen.gmfgen.GenLanguage
* @see #getLanguage()
* @generated
*/
- void setLanguage(String value);
+ void setLanguage(GenLanguage value);
+
+ /**
+ * Returns the value of the '<em><b>Lang Name</b></em>' attribute.
+ * <!-- begin-user-doc -->
+ * <p>
+ * If the meaning of the '<em>Lang Name</em>' attribute isn't clear,
+ * there really should be more of a description here...
+ * </p>
+ * <!-- end-user-doc -->
+ * @return the value of the '<em>Lang Name</em>' attribute.
+ * @see org.eclipse.gmf.codegen.gmfgen.GMFGenPackage#getValueExpression_LangName()
+ * @model transient="true" changeable="false" volatile="true" derived="true"
+ * annotation="http://www.eclipse.org/gmf/2005/constraints/meta def='lang'"
+ * @generated
+ */
+ String getLangName();
boolean isOCLExpression();
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
index db2feee39..998e0654b 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenFactoryImpl.java
@@ -182,6 +182,8 @@ public class GMFGenFactoryImpl extends EFactoryImpl implements GMFGenFactory {
return createViewmapLayoutTypeFromString(eDataType, initialValue);
case GMFGenPackage.GEN_SEVERITY:
return createGenSeverityFromString(eDataType, initialValue);
+ case GMFGenPackage.GEN_LANGUAGE:
+ return createGenLanguageFromString(eDataType, initialValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -202,6 +204,8 @@ public class GMFGenFactoryImpl extends EFactoryImpl implements GMFGenFactory {
return convertViewmapLayoutTypeToString(eDataType, instanceValue);
case GMFGenPackage.GEN_SEVERITY:
return convertGenSeverityToString(eDataType, instanceValue);
+ case GMFGenPackage.GEN_LANGUAGE:
+ return convertGenLanguageToString(eDataType, instanceValue);
default:
throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
}
@@ -802,6 +806,26 @@ public class GMFGenFactoryImpl extends EFactoryImpl implements GMFGenFactory {
* <!-- end-user-doc -->
* @generated
*/
+ public GenLanguage createGenLanguageFromString(EDataType eDataType, String initialValue) {
+ GenLanguage result = GenLanguage.get(initialValue);
+ if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
+ return result;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ public String convertGenLanguageToString(EDataType eDataType, Object instanceValue) {
+ return instanceValue == null ? null : instanceValue.toString();
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public GMFGenPackage getGMFGenPackage() {
return (GMFGenPackage)getEPackage();
}
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
index 324fdac8f..e25436a29 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GMFGenPackageImpl.java
@@ -58,6 +58,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenFeatureSeqInitializer;
import org.eclipse.gmf.codegen.gmfgen.GenFeatureValueSpec;
import org.eclipse.gmf.codegen.gmfgen.GenJavaExpressionProvider;
import org.eclipse.gmf.codegen.gmfgen.GenLabel;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
import org.eclipse.gmf.codegen.gmfgen.GenLinkConstraints;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
@@ -693,6 +694,13 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
private EEnum genSeverityEEnum = null;
/**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ private EEnum genLanguageEEnum = null;
+
+ /**
* Creates an instance of the model <b>Package</b>, registered with
* {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
* package URI value.
@@ -2826,6 +2834,15 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EAttribute getValueExpression_LangName() {
+ return (EAttribute)valueExpressionEClass.getEStructuralFeatures().get(2);
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public EClass getGenConstraint() {
return genConstraintEClass;
}
@@ -3717,6 +3734,15 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
* <!-- end-user-doc -->
* @generated
*/
+ public EEnum getGenLanguage() {
+ return genLanguageEEnum;
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
public GMFGenFactory getGMFGenFactory() {
return (GMFGenFactory)getEFactoryInstance();
}
@@ -4017,6 +4043,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
valueExpressionEClass = createEClass(VALUE_EXPRESSION);
createEAttribute(valueExpressionEClass, VALUE_EXPRESSION__BODY);
createEAttribute(valueExpressionEClass, VALUE_EXPRESSION__LANGUAGE);
+ createEAttribute(valueExpressionEClass, VALUE_EXPRESSION__LANG_NAME);
genConstraintEClass = createEClass(GEN_CONSTRAINT);
@@ -4147,6 +4174,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
linkLabelAlignmentEEnum = createEEnum(LINK_LABEL_ALIGNMENT);
viewmapLayoutTypeEEnum = createEEnum(VIEWMAP_LAYOUT_TYPE);
genSeverityEEnum = createEEnum(GEN_SEVERITY);
+ genLanguageEEnum = createEEnum(GEN_LANGUAGE);
}
/**
@@ -4685,7 +4713,8 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
initEClass(valueExpressionEClass, ValueExpression.class, "ValueExpression", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getValueExpression_Body(), ecorePackage.getEString(), "body", null, 1, 1, ValueExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getValueExpression_Language(), ecorePackage.getEString(), "language", "ocl", 0, 1, ValueExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getValueExpression_Language(), this.getGenLanguage(), "language", "ocl", 1, 1, ValueExpression.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getValueExpression_LangName(), ecorePackage.getEString(), "langName", null, 0, 1, ValueExpression.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
initEClass(genConstraintEClass, GenConstraint.class, "GenConstraint", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -4851,7 +4880,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
addEOperation(genExpressionProviderBaseEClass, ecorePackage.getEString(), "getRequiredPluginIDs", 0, -1);
- addEOperation(genExpressionProviderBaseEClass, ecorePackage.getEString(), "getLanguage", 1, 1);
+ addEOperation(genExpressionProviderBaseEClass, this.getGenLanguage(), "getLanguage", 1, 1);
initEClass(genJavaExpressionProviderEClass, GenJavaExpressionProvider.class, "GenJavaExpressionProvider", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -4859,7 +4888,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
addEParameter(op, this.getValueExpression(), "expression", 1, 1);
initEClass(genExpressionInterpreterEClass, GenExpressionInterpreter.class, "GenExpressionInterpreter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getGenExpressionInterpreter_Language(), ecorePackage.getEString(), "language", null, 0, 1, GenExpressionInterpreter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEAttribute(getGenExpressionInterpreter_Language(), this.getGenLanguage(), "language", null, 1, 1, GenExpressionInterpreter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getGenExpressionInterpreter_ClassName(), ecorePackage.getEString(), "className", null, 0, 1, GenExpressionInterpreter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getGenExpressionInterpreter_RequiredPluginIDs(), ecorePackage.getEString(), "requiredPluginIDs", null, 0, -1, GenExpressionInterpreter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -4892,6 +4921,12 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
addEEnumLiteral(genSeverityEEnum, GenSeverity.WARNING_LITERAL);
addEEnumLiteral(genSeverityEEnum, GenSeverity.ERROR_LITERAL);
+ initEEnum(genLanguageEEnum, GenLanguage.class, "GenLanguage");
+ addEEnumLiteral(genLanguageEEnum, GenLanguage.OCL_LITERAL);
+ addEEnumLiteral(genLanguageEEnum, GenLanguage.JAVA_LITERAL);
+ addEEnumLiteral(genLanguageEEnum, GenLanguage.REGEXP_LITERAL);
+ addEEnumLiteral(genLanguageEEnum, GenLanguage.NREGEXP_LITERAL);
+
// Create resource
createResource(eNS_URI);
@@ -5148,7 +5183,7 @@ public class GMFGenPackageImpl extends EPackageImpl implements GMFGenPackage {
"def", "body"
});
addAnnotation
- (getValueExpression_Language(),
+ (getValueExpression_LangName(),
source,
new String[] {
"def", "lang"
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionInterpreterImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionInterpreterImpl.java
index 51935e696..45cb53496 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionInterpreterImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionInterpreterImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenExpressionInterpreterImpl.java,v 1.1 2006/04/13 15:41:17 radvorak Exp $
+ * $Id: GenExpressionInterpreterImpl.java,v 1.2 2006/06/06 16:22:23 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen.impl;
@@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
/**
@@ -42,7 +43,7 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
* @generated
* @ordered
*/
- protected static final String LANGUAGE_EDEFAULT = null;
+ protected static final GenLanguage LANGUAGE_EDEFAULT = GenLanguage.OCL_LITERAL;
/**
* The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
@@ -52,7 +53,7 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
* @generated
* @ordered
*/
- protected String language = LANGUAGE_EDEFAULT;
+ protected GenLanguage language = LANGUAGE_EDEFAULT;
/**
* The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
@@ -120,7 +121,7 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
String value = getClassNameGen();
if(value == null || value.length() == 0) {
String prefix = ((GenEditorGeneratorImpl) getContainer().getEditorGen()).getDomainModelCapName();
- value = prefix + CodeGenUtil.validJavaIdentifier(getLanguage().toUpperCase()) + "Factory"; //$NON-NLS-1$
+ value = prefix + CodeGenUtil.validJavaIdentifier(getLanguage().getName().toUpperCase()) + "Factory"; //$NON-NLS-1$
}
return value;
}
@@ -154,31 +155,18 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
* <!-- end-user-doc -->
* @generated
*/
- public String getLanguageGen() {
+ public GenLanguage getLanguage() {
return language;
}
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @generated NOT
- */
- public String getLanguage() {
- String value = getLanguageGen();
- if(value == null || value.length() == 0) {
- value = "ocl"; //$NON-NLS-1$
- }
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
* @generated
*/
- public void setLanguage(String newLanguage) {
- String oldLanguage = language;
- language = newLanguage;
+ public void setLanguage(GenLanguage newLanguage) {
+ GenLanguage oldLanguage = language;
+ language = newLanguage == null ? LANGUAGE_EDEFAULT : newLanguage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.GEN_EXPRESSION_INTERPRETER__LANGUAGE, oldLanguage, language));
}
@@ -226,7 +214,7 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER__LANGUAGE:
- setLanguage((String)newValue);
+ setLanguage((GenLanguage)newValue);
return;
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER__CLASS_NAME:
setClassName((String)newValue);
@@ -267,7 +255,7 @@ public class GenExpressionInterpreterImpl extends GenExpressionProviderBaseImpl
public boolean eIsSet(int featureID) {
switch (featureID) {
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER__LANGUAGE:
- return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language);
+ return language != LANGUAGE_EDEFAULT;
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER__CLASS_NAME:
return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
case GMFGenPackage.GEN_EXPRESSION_INTERPRETER__REQUIRED_PLUGIN_IDS:
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionProviderBaseImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionProviderBaseImpl.java
index 2ed02920b..6d01ab72a 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionProviderBaseImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenExpressionProviderBaseImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenExpressionProviderBaseImpl.java,v 1.3 2006/05/24 16:22:38 radvorak Exp $
+ * $Id: GenExpressionProviderBaseImpl.java,v 1.4 2006/06/06 16:22:23 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen.impl;
@@ -25,6 +25,7 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
/**
@@ -75,7 +76,7 @@ public abstract class GenExpressionProviderBaseImpl extends EObjectImpl implemen
* <!-- end-user-doc -->
* @generated NOT
*/
- public abstract String getLanguage();
+ public abstract GenLanguage getLanguage();
/**
* <!-- begin-user-doc -->
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenJavaExpressionProviderImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenJavaExpressionProviderImpl.java
index c60fb35e3..d9b993a1a 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenJavaExpressionProviderImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/GenJavaExpressionProviderImpl.java
@@ -2,7 +2,7 @@
* <copyright>
* </copyright>
*
- * $Id: GenJavaExpressionProviderImpl.java,v 1.1 2006/04/13 15:41:17 radvorak Exp $
+ * $Id: GenJavaExpressionProviderImpl.java,v 1.2 2006/06/06 16:22:23 radvorak Exp $
*/
package org.eclipse.gmf.codegen.gmfgen.impl;
@@ -10,6 +10,7 @@ import org.eclipse.emf.codegen.util.CodeGenUtil;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
import org.eclipse.gmf.codegen.gmfgen.GenJavaExpressionProvider;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
/**
@@ -45,8 +46,8 @@ public class GenJavaExpressionProviderImpl extends GenExpressionProviderBaseImpl
* <!-- end-user-doc -->
* @generated NOT
*/
- public String getLanguage() {
- return "java"; //$NON-NLS-1$
+ public GenLanguage getLanguage() {
+ return GenLanguage.JAVA_LITERAL;
}
/**
diff --git a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/ValueExpressionImpl.java b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/ValueExpressionImpl.java
index 24310ae31..78262da0f 100644
--- a/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/ValueExpressionImpl.java
+++ b/plugins/org.eclipse.gmf.codegen/src/org/eclipse/gmf/codegen/gmfgen/impl/ValueExpressionImpl.java
@@ -11,6 +11,7 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.eclipse.gmf.codegen.gmfgen.GMFGenPackage;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
/**
@@ -22,6 +23,7 @@ import org.eclipse.gmf.codegen.gmfgen.ValueExpression;
* <ul>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl#getBody <em>Body</em>}</li>
* <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl#getLanguage <em>Language</em>}</li>
+ * <li>{@link org.eclipse.gmf.codegen.gmfgen.impl.ValueExpressionImpl#getLangName <em>Lang Name</em>}</li>
* </ul>
* </p>
*
@@ -56,7 +58,7 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
* @generated
* @ordered
*/
- protected static final String LANGUAGE_EDEFAULT = "ocl";
+ protected static final GenLanguage LANGUAGE_EDEFAULT = GenLanguage.OCL_LITERAL;
/**
* The cached value of the '{@link #getLanguage() <em>Language</em>}' attribute.
@@ -66,7 +68,17 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
* @generated
* @ordered
*/
- protected String language = LANGUAGE_EDEFAULT;
+ protected GenLanguage language = LANGUAGE_EDEFAULT;
+
+ /**
+ * The default value of the '{@link #getLangName() <em>Lang Name</em>}' attribute.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @see #getLangName()
+ * @generated
+ * @ordered
+ */
+ protected static final String LANG_NAME_EDEFAULT = null;
/**
* <!-- begin-user-doc -->
@@ -92,7 +104,7 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
* @generated NOT
*/
public boolean isOCLExpression() {
- return "ocl".equals(getLanguage()); //$NON-NLS-1$
+ return GenLanguage.OCL_LITERAL.equals(getLanguage());
}
/**
@@ -121,7 +133,7 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
* <!-- end-user-doc -->
* @generated
*/
- public String getLanguage() {
+ public GenLanguage getLanguage() {
return language;
}
@@ -130,9 +142,9 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
* <!-- end-user-doc -->
* @generated
*/
- public void setLanguage(String newLanguage) {
- String oldLanguage = language;
- language = newLanguage;
+ public void setLanguage(GenLanguage newLanguage) {
+ GenLanguage oldLanguage = language;
+ language = newLanguage == null ? LANGUAGE_EDEFAULT : newLanguage;
if (eNotificationRequired())
eNotify(new ENotificationImpl(this, Notification.SET, GMFGenPackage.VALUE_EXPRESSION__LANGUAGE, oldLanguage, language));
}
@@ -140,6 +152,16 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
+ * @generated NOT
+ */
+ public String getLangName() {
+ GenLanguage langEnum = getLanguage();
+ return (langEnum != null) ? langEnum.getName() : ""; //$NON-NLS-1$
+ }
+
+ /**
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
* @generated
*/
public Object eGet(int featureID, boolean resolve, boolean coreType) {
@@ -148,6 +170,8 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
return getBody();
case GMFGenPackage.VALUE_EXPRESSION__LANGUAGE:
return getLanguage();
+ case GMFGenPackage.VALUE_EXPRESSION__LANG_NAME:
+ return getLangName();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -163,7 +187,7 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
setBody((String)newValue);
return;
case GMFGenPackage.VALUE_EXPRESSION__LANGUAGE:
- setLanguage((String)newValue);
+ setLanguage((GenLanguage)newValue);
return;
}
super.eSet(featureID, newValue);
@@ -196,7 +220,9 @@ public class ValueExpressionImpl extends EObjectImpl implements ValueExpression
case GMFGenPackage.VALUE_EXPRESSION__BODY:
return BODY_EDEFAULT == null ? body != null : !BODY_EDEFAULT.equals(body);
case GMFGenPackage.VALUE_EXPRESSION__LANGUAGE:
- return LANGUAGE_EDEFAULT == null ? language != null : !LANGUAGE_EDEFAULT.equals(language);
+ return language != LANGUAGE_EDEFAULT;
+ case GMFGenPackage.VALUE_EXPRESSION__LANG_NAME:
+ return LANG_NAME_EDEFAULT == null ? getLangName() != null : !LANG_NAME_EDEFAULT.equals(getLangName());
}
return super.eIsSet(featureID);
}
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 b4872d2c3..0d5f7dc82 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
@@ -38,6 +38,7 @@ import org.eclipse.gmf.codegen.gmfgen.GenExpressionInterpreter;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderBase;
import org.eclipse.gmf.codegen.gmfgen.GenExpressionProviderContainer;
import org.eclipse.gmf.codegen.gmfgen.GenExternalNodeLabel;
+import org.eclipse.gmf.codegen.gmfgen.GenLanguage;
import org.eclipse.gmf.codegen.gmfgen.GenLink;
import org.eclipse.gmf.codegen.gmfgen.GenLinkLabel;
import org.eclipse.gmf.codegen.gmfgen.GenNode;
@@ -845,9 +846,9 @@ public class Generator extends GeneratorBase implements Runnable {
GenExpressionProviderBase nextProvider = (GenExpressionProviderBase) it.next();
if(nextProvider instanceof GenExpressionInterpreter) {
JETEmitter providerEmitter = null;
- if("ocl".equals(nextProvider.getLanguage())) { //$NON-NLS-1$
+ if(GenLanguage.OCL_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getOCLExpressionFactoryEmitter();
- } else if("regexp".equals(nextProvider.getLanguage()) || "nregexp".equals(nextProvider.getLanguage())) { //$NON-NLS-1$ //$NON-NLS-2$
+ } else if(GenLanguage.REGEXP_LITERAL.equals(nextProvider.getLanguage()) || GenLanguage.NREGEXP_LITERAL.equals(nextProvider.getLanguage())) {
providerEmitter = myEmitters.getRegexpExpressionFactoryEmitter();
}
GenExpressionInterpreter interpreter = (GenExpressionInterpreter)nextProvider;
diff --git a/plugins/org.eclipse.gmf.codegen/templates/expressions/RegexpExpressionFactory.javajet b/plugins/org.eclipse.gmf.codegen/templates/expressions/RegexpExpressionFactory.javajet
index 5279f406b..da6181c67 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/expressions/RegexpExpressionFactory.javajet
+++ b/plugins/org.eclipse.gmf.codegen/templates/expressions/RegexpExpressionFactory.javajet
@@ -6,7 +6,7 @@ final ImportAssistant importManager = (ImportAssistant) ((Object[]) argument)[1]
final GenDiagram genDiagram = genInterpreter.getContainer().getEditorGen().getDiagram();
final String factoryClassName = genInterpreter.getClassName();
final String abstractExpressionClass = genInterpreter.getContainer().getAbstractExpressionQualifiedClassName();
-final boolean isNegationRegexp = !"regexp".equals(genInterpreter.getLanguage());
+final boolean isNegationRegexp = !GenLanguage.REGEXP_LITERAL.equals(genInterpreter.getLanguage());
%>
<%@ include file="../copyright4java.jetinc"%>
<%importManager.emitPackageStatement(stringBuffer);%>

Back to the top