aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorghillairet2012-05-15 11:37:41 (EDT)
committermgolubev2012-05-15 11:37:41 (EDT)
commit923a4ed696f15c092ea31c4817b5e4e59910b45e (patch)
tree9cb6b398fc83d3bca1e7f2dac6852257fe67782b
parent754f9bdd725e6c565c35ceceb107bf599789d079 (diff)
downloadorg.eclipse.gmf-tooling-923a4ed696f15c092ea31c4817b5e4e59910b45e.zip
org.eclipse.gmf-tooling-923a4ed696f15c092ea31c4817b5e4e59910b45e.tar.gz
org.eclipse.gmf-tooling-923a4ed696f15c092ea31c4817b5e4e59910b45e.tar.bz2
Added helper for creation of CustomBehaviours for TopNodeReference
Fixed editPolicyQualifiedClassName
-rw-r--r--plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto30
1 files changed, 16 insertions, 14 deletions
diff --git a/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto b/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
index 6a13e8e..1b3fcca 100644
--- a/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
+++ b/plugins/org.eclipse.gmf.bridge/transforms/CustomBehaviours.qvto
@@ -22,20 +22,20 @@ modeltype ECORE uses ecore('http://www.eclipse.org/emf/2002/Ecore');
--
helper GMFMAP::Mapping::customBehaviours() {
- self.nodes->collect(e |
- if e.resolveone(GenTopLevelNode).visualID <= 0 then {
- var genNode := e.resolveone(GenTopLevelNode);
- genNode.behaviour += e.child.visualEffects->map createVisualEffects(genNode);
- e.child.children->collect(customBehaviours());
- } endif
- );
-
+ self.nodes->collect(customBehaviours());
self.links->collect(customBehaviours());
-- self.getCompartments()->collect(e | e.c.customBehaviours(e.n, e.r));
return;
}
+helper GMFMAP::TopNodeReference::customBehaviours() {
+ var genNode := self.resolveone(GenTopLevelNode);
+ genNode.behaviour += self.child.visualEffects->map createVisualEffects(genNode);
+ self.child.children->collect(customBehaviours());
+ return;
+}
+
helper GMFMAP::ChildReference::customBehaviours() {
var node := self.findProcessableChildReference();
if not node.oclIsUndefined() then
@@ -60,11 +60,7 @@ mapping GMFMAP::VisualEffectMapping::createVisualEffects(parent: GMFGEN::GenComm
operationType := self.diagramPin.getOperationType();
oclExpression := self.oclExpression;
- editPolicyQualifiedClassName :=
- parent.getDiagram().editPoliciesPackageName +
- '.' +
- self.diagramPin.name.firstToUpper() + // FIXME Should be valid Java Class Name
- parent.visualID.toString();
+ editPolicyQualifiedClassName := parent.getEditPolicyQualifiedClassName(self.diagramPin);
key := result.editPolicyQualifiedClassName + '.KEY';
}
@@ -72,6 +68,11 @@ mapping GMFMAP::VisualEffectMapping::createVisualEffects(parent: GMFGEN::GenComm
-- Helpers
--
+helper GMFGEN::GenCommonBase::getEditPolicyQualifiedClassName(pin: Pin): String =
+ self.getDiagram().editPoliciesPackageName + '.' +
+ pin.name.firstToUpper() + // FIXME Should be valid Java Class Name
+ self.visualID.toString() + 'Policy';
+
helper GMFGRAPH::DiagramElement::getOperationName(pin: GMFGRAPH::Pin): String =
if not self.figure.actualFigure.hasFigurePin(pin) then
let graphChildAccess = self.figure.accessors->any(figure.hasFigurePin(pin)) in
@@ -87,4 +88,5 @@ helper GMFGRAPH::Figure::hasFigurePin(pin: GMFGRAPH::Pin): Boolean =
if self.oclIsTypeOf(FigureRef) then
self.oclAsType(FigureRef).figure
else self.oclAsType(RealFigure) endif
- in realFigure.pins->includes(pin);
+ in
+ realFigure.pins->includes(pin);