Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormgolubev2012-05-02 01:09:25 +0000
committermgolubev2012-05-02 01:40:46 +0000
commit686ae22a066b6171ab2d44855e006062a397954e (patch)
treec17c72deb4ab4ade8101f4c3a493cc35a6551b72
parent9e20b2012f162356ef82bb80dbbb790ac1a98c21 (diff)
downloadorg.eclipse.gmf-tooling-686ae22a066b6171ab2d44855e006062a397954e.tar.gz
org.eclipse.gmf-tooling-686ae22a066b6171ab2d44855e006062a397954e.tar.xz
org.eclipse.gmf-tooling-686ae22a066b6171ab2d44855e006062a397954e.zip
[237059] - fixed, custom reparent-aware editpolicy is generated for all
containers
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/CompartmentEditPart.xpt2
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/DiagramEditPart.xpt1
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt4
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Common.xpt11
4 files changed, 13 insertions, 5 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/CompartmentEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/CompartmentEditPart.xpt
index 7496ea1f1..7a23ec329 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/CompartmentEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/CompartmentEditPart.xpt
@@ -56,7 +56,7 @@
«ENDIF-»
«EXPAND xpt::diagram::editparts::Common::installSemanticEditPolicy-»
«IF childNodes->size() > 0-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy());
+ «EXPAND xpt::diagram::editparts::Common::installCreationEditPolicy-»
installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DragDropEditPolicy());
«ENDIF-»
«EXPAND xpt::diagram::editparts::Common::installCanonicalEditPolicy-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/DiagramEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/DiagramEditPart.xpt
index 4223e28e6..134927356 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/DiagramEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/DiagramEditPart.xpt
@@ -25,6 +25,7 @@
super.createDefaultEditPolicies();
«EXPAND xpt::diagram::editparts::Common::installSemanticEditPolicy-»
«EXPAND xpt::diagram::editparts::Common::installCanonicalEditPolicy-»
+ «EXPAND xpt::diagram::editparts::Common::installCreationEditPolicy-»
«IF generateCreateShortcutAction() and null = editorGen.application-»
installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.DRAG_DROP_ROLE, new org.eclipse.gmf.runtime.diagram.ui.editpolicies.DiagramDragDropEditPolicy() {
public org.eclipse.gef.commands.Command getDropObjectsCommand(org.eclipse.gmf.runtime.diagram.ui.requests.DropObjectsRequest dropRequest) {
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
index f7c44be6f..ce6f4056c 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/NodeEditPart.xpt
@@ -52,12 +52,10 @@
«DEFINE installCreationRolePolicy FOR gmfgen::GenNode-»
«IF self.childNodes->notEmpty() or hasChildrenInListCompartments(self)-»
- installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, «EXPAND _creationEditPolicyNewInstance»);
+ «EXPAND xpt::diagram::editparts::Common::installCreationEditPolicy-»
«ENDIF-»
«ENDDEFINE»
-«DEFINE _creationEditPolicyNewInstance FOR gmfgen::GenNode»new org.eclipse.gmf.runtime.diagram.ui.editpolicies.CreationEditPolicy()«ENDDEFINE»
-
«DEFINE installPrimaryDragEditPolicy FOR gmfgen::GenNode»«ENDDEFINE»
«DEFINE installPrimaryDragEditPolicy FOR gmfgen::GenChildSideAffixedNode-»
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Common.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Common.xpt
index 44861a7ba..8b55b7926 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Common.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/diagram/editparts/Common.xpt
@@ -150,4 +150,13 @@ installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRole
«IF needsCanonicalEditPolicy()-»
installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CANONICAL_ROLE, new «getCanonicalEditPolicyQualifiedClassName()»());
«ENDIF-»
-«ENDDEFINE» \ No newline at end of file
+«ENDDEFINE»
+
+«DEFINE installCreationEditPolicy FOR gmfgen::GenCommonBase-»
+installEditPolicy(org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles.CREATION_ROLE, «EXPAND _creationEditPolicyNewInstance»);
+«ENDDEFINE»
+
+«DEFINE _creationEditPolicyNewInstance FOR gmfgen::GenCommonBase-»
+new org.eclipse.gmf.tooling.runtime.edit.policies.reparent.CreationEditPolicyWithCustomReparent(«EXPAND xpt::editor::VisualIDRegistry::runtimeTypedInstanceCall FOR self.getDiagram()»)«-»
+«ENDDEFINE»
+

Back to the top