summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskovalsky2012-03-18 18:37:47 (EDT)
committer mgolubev2012-03-18 18:37:47 (EDT)
commit6ba37f8c65a3a68a52034ae28bf6cdac247e376f (patch)
tree48a5e019271293a254a9318eeea90677ee58134f
parent8e9a1ba56437aa6202353395ed73e7aeb2aabba8 (diff)
downloadorg.eclipse.gmf-tooling-6ba37f8c65a3a68a52034ae28bf6cdac247e376f.zip
org.eclipse.gmf-tooling-6ba37f8c65a3a68a52034ae28bf6cdac247e376f.tar.gz
org.eclipse.gmf-tooling-6ba37f8c65a3a68a52034ae28bf6cdac247e376f.tar.bz2
[374583] - OCL-choice parser: support in (java) bridge
-rw-r--r--plugins/org.eclipse.gmf.bridge/src/org/eclipse/gmf/internal/bridge/genmodel/DiagramGenModelTransformer.java23
1 files changed, 23 insertions, 0 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 5c07d0b..de040db 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
@@ -102,6 +102,7 @@ import org.eclipse.gmf.codegen.gmfgen.LabelTextAccessMethod;
import org.eclipse.gmf.codegen.gmfgen.LinkLabelAlignment;
import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
import org.eclipse.gmf.codegen.gmfgen.MetamodelType;
+import org.eclipse.gmf.codegen.gmfgen.OclChoiceParser;
import org.eclipse.gmf.codegen.gmfgen.OpenDiagramBehaviour;
import org.eclipse.gmf.codegen.gmfgen.Palette;
import org.eclipse.gmf.codegen.gmfgen.PredefinedEnumParser;
@@ -156,6 +157,7 @@ import org.eclipse.gmf.mappings.MetricRule;
import org.eclipse.gmf.mappings.NodeMapping;
import org.eclipse.gmf.mappings.NodeReference;
import org.eclipse.gmf.mappings.NotationElementTarget;
+import org.eclipse.gmf.mappings.OclChoiceLabelMapping;
import org.eclipse.gmf.mappings.ReferenceNewElementSpec;
import org.eclipse.gmf.mappings.Severity;
import org.eclipse.gmf.mappings.TopNodeReference;
@@ -700,6 +702,15 @@ public class DiagramGenModelTransformer extends MappingTransformer {
// XXX
return modelFacet;
}
+ if (mapping instanceof OclChoiceLabelMapping) {
+ OclChoiceLabelMapping oclMapping = (OclChoiceLabelMapping) mapping;
+ FeatureLabelModelFacet modelFacet = GMFGenFactory.eINSTANCE.createFeatureLabelModelFacet();
+ GenFeature feature = findGenFeature(oclMapping.getFeature());
+ modelFacet.getMetaFeatures().add(feature);
+ modelFacet.getEditableMetaFeatures().add(feature);
+ modelFacet.setParser(createOclChoiceParser(oclMapping));
+ return modelFacet;
+ }
if (mapping instanceof DesignLabelMapping) {
DesignLabelModelFacet modelFacet = GMFGenFactory.eINSTANCE.createDesignLabelModelFacet();
modelFacet.setParser(getOrCreateParser((DesignLabelMapping) mapping));
@@ -1439,6 +1450,18 @@ public class DiagramGenModelTransformer extends MappingTransformer {
return result;
}
+ private GenParserImplementation createOclChoiceParser(OclChoiceLabelMapping oclMapping) {
+ OclChoiceParser result = GMFGenFactory.eINSTANCE.createOclChoiceParser();
+ if (oclMapping.getItemsExpression() != null) {
+ result.setItemsExpression(createValueExpression(oclMapping.getItemsExpression()));
+ }
+ if (oclMapping.getShowExpression() != null) {
+ result.setShowExpression(createValueExpression(oclMapping.getShowExpression()));
+ }
+ getGenParsers().getImplementations().add(result);
+ return result;
+ }
+
private GenParserImplementation getOrCreatePredefinedParser(FeatureLabelMapping flMapping) {
final LabelTextAccessMethod editMethod = LabelTextAccessMethod.get(flMapping.getEditMethod().getValue());
final LabelTextAccessMethod viewMethod = LabelTextAccessMethod.get(flMapping.getViewMethod().getValue());