carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/policies/ConnectionEndpointEditPolicy.xpt
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/policies/ConnectionEndpointEditPolicy.xpt Fri Dec 04 11:06:59 2009 -0600
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2007 Borland Software Corporation
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * bblajer (Borland) - initial API and implementation
+ */
+
+«IMPORT "http://www.eclipse.org/gmf/2008/GenModel"»
+«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
+«IMPORT "http://www.eclipse.org/emf/2002/GenModel"»
+«EXTENSION xpt::GenModelUtils»
+«EXTENSION xpt::diagram::policies::ClassNames»
+
+«DEFINE ConnectionEndpointEditPolicy FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::copyright FOR getDiagram().editorGen»
+package «getDiagram().editPoliciesPackageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «EXPAND className» «EXPAND supertypes» {
+«EXPAND createSelectionHandles-»
+«EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE className FOR gmfgen::GenLink»«getConnectionEndpointEditPolicyClassName()»«ENDDEFINE»
+«DEFINE qualifiedClassName FOR gmfgen::GenLink»«getDiagram().editPoliciesPackageName».«EXPAND className»«ENDDEFINE»
+
+«DEFINE supertypes FOR gmfgen::GenLink»extends org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy«ENDDEFINE»
+
+«DEFINE createSelectionHandles FOR gmfgen::GenLink-»
+«IF labels.size() > 0-»
+«EXPAND xpt::Common::generatedMemberComment»
+protected java.util.List createSelectionHandles() {
+ java.util.List result = super.createSelectionHandles();
+ for(java.util.Iterator it = getHost().getChildren().iterator(); it.hasNext(); ) {
+ org.eclipse.gef.EditPart next = (org.eclipse.gef.EditPart) it.next();
+ org.eclipse.gmf.runtime.notation.View nextView = (org.eclipse.gmf.runtime.notation.View) next.getModel();
+ switch («getDiagram().getVisualIDRegistryQualifiedClassName()».getVisualID(nextView)) {
+ «EXPAND addSelectionHandles FOREACH labels-»
+ }
+ }
+ return result;
+}
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE addSelectionHandles FOR gmfgen::GenLinkLabel-»
+case «getEditPartQualifiedClassName()».VISUAL_ID:
+ result.addAll(((«getEditPartQualifiedClassName()») next).createSelectionHandles());
+ break;
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenLink»«ENDDEFINE»