carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/parts/LinkEditPart.xpt
changeset 422 033392511bf7
--- /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/parts/LinkEditPart.xpt	Fri Dec 04 11:06:59 2009 -0600
@@ -0,0 +1,142 @@
+/*
+ * 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::diagram::parts::Common»
+
+«DEFINE LinkEditPart FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
+package «getDiagram().editPartsPackageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «editPartClassName» «EXPAND supertypes» {
+	«EXPAND xpt::diagram::parts::Common::visualIDConstant-»
+
+	«EXPAND xpt::diagram::parts::Common::ctors-»
+	«EXPAND xpt::diagram::parts::Common::declareViewCode-»
+	«EXPAND xpt::diagram::parts::Common::registerModel-»
+	«EXPAND xpt::diagram::parts::Common::getModelChildren-»
+	«EXPAND xpt::diagram::parts::Common::getModelSourceConnections-»
+	«EXPAND xpt::diagram::parts::Common::getModelTargetConnections-»
+	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::all-»
+	«EXPAND connectionAnchors-»
+	«EXPAND xpt::diagram::parts::decorations::decorationManager-»
+	«EXPAND createEditPolicies-»
+
+	«EXPAND xpt::diagram::parts::requests::getPrimaryLabelEditPart-»
+	«EXPAND xpt::diagram::parts::requests::performRequest-»
+	«EXPAND xpt::diagram::parts::requests::getLabelEditPart-»
+
+	«EXPAND xpt::diagram::parts::Common::getAdapter-»
+	«EXPAND xpt::diagram::parts::TreeEditPart::getTreeEditPartAdapter-»
+	«EXPAND xpt::diagram::parts::Common::activate-»
+	«EXPAND xpt::diagram::parts::Common::deactivate-»
+	«EXPAND xpt::diagram::parts::Common::getTransactionalUpdateManager-»
+	«EXPAND xpt::diagram::parts::refresh::refresher-»
+	«EXPAND xpt::diagram::parts::refresh::externalRefreshers-»
+
+	«EXPAND addNotify-»
+	«EXPAND createFigure-»
+
+	«EXPAND xpt::diagram::parts::decorations::createDecorationManager-»
+	«EXPAND primCreateFigure-»
+	«EXPAND xpt::diagram::parts::Common::viewmap FOR viewmap-»
+	«EXPAND xpt::diagram::parts::TreeEditPart::TreeEditPart-»
+	«EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE supertypes FOR gmfgen::GenLink»extends org.eclipse.gef.editparts.AbstractConnectionEditPart implements org.eclipse.gmf.runtime.lite.edit.parts.update.IUpdatableEditPart, org.eclipse.gmf.runtime.lite.edit.parts.update.IExternallyUpdatableEditPart, org.eclipse.gmf.runtime.lite.edit.parts.decorations.IDecoratableEditPart, org.eclipse.gef.NodeEditPart«ENDDEFINE»
+
+«DEFINE createEditPolicies FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::generatedMemberComment»
+protected void createEditPolicies() {
+	installEditPolicy(org.eclipse.gef.EditPolicy.COMPONENT_ROLE, new «EXPAND xpt::diagram::policies::ComponentEditPolicy::qualifiedClassName»());
+	installEditPolicy(org.eclipse.gef.EditPolicy.CONNECTION_ENDPOINTS_ROLE, «IF labels.size() > 0»new «EXPAND xpt::diagram::policies::ConnectionEndpointEditPolicy::qualifiedClassName»()«ELSE»new org.eclipse.gef.editpolicies.ConnectionEndpointEditPolicy()«ENDIF»);
+	installEditPolicy(org.eclipse.gef.EditPolicy.CONNECTION_BENDPOINTS_ROLE, new org.eclipse.gmf.runtime.lite.edit.policies.BendpointEditPolicy());
+«IF getPrimaryLabel() != null-»
+	installEditPolicy(org.eclipse.gef.EditPolicy.DIRECT_EDIT_ROLE, new org.eclipse.gmf.runtime.lite.edit.policies.DelegatingDirectEditPolicy());
+«ENDIF-»
+	installEditPolicy(org.eclipse.gef.EditPolicy.GRAPHICAL_NODE_ROLE, new «EXPAND xpt::diagram::policies::GraphicalNodeEditPolicy::qualifiedClassName»());
+	«EXPAND xpt::diagram::parts::Common::behaviour-»
+	«EXPAND xpt::diagram::parts::LinkNotationModelRefresher::installClause-»
+}
+«ENDDEFINE»
+
+«DEFINE addNotify FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::generatedMemberComment»
+public void addNotify() {
+	super.addNotify();
+	getConnectionFigure().setConnectionRouter(«EXPAND instantiateConnectionRouter»);
+}
+«ENDDEFINE»
+
+«DEFINE instantiateConnectionRouter FOR gmfgen::GenLink»new org.eclipse.draw2d.BendpointConnectionRouter()«ENDDEFINE»
+
+«DEFINE createFigure FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::generatedMemberComment»
+protected org.eclipse.draw2d.IFigure createFigure() {
+	org.eclipse.draw2d.Connection result = primCreateFigure();
+	myDecorationManager = createDecorationManager(result);
+	return result;
+}
+«ENDDEFINE»
+
+«DEFINE primCreateFigure FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::generatedMemberComment("Creates figure for this edit part.\n\n" + 
+"Body of this method does not depend on settings in generation model\n" + 
+"so you may safely remove <i>generated</i> tag and modify it.\n")»
+private org.eclipse.draw2d.Connection primCreateFigure() {
+	«EXPAND primCreateFigure FOR viewmap-»
+}
+«ENDDEFINE»
+
+«DEFINE primCreateFigure FOR gmfgen::Viewmap»«ERROR "Unexpected viewmap type " + this»«ENDDEFINE»
+
+«DEFINE primCreateFigure FOR gmfgen::FigureViewmap-»
+	return new «figureQualifiedClassName == null ? "org.eclipse.draw2d.PolylineConnection" : figureQualifiedClassName»();
+«ENDDEFINE»
+
+«DEFINE primCreateFigure FOR gmfgen::SnippetViewmap-»
+	return «body»;
+«ENDDEFINE»
+
+«DEFINE primCreateFigure FOR gmfgen::InnerClassViewmap-»
+	return new «className»();
+«ENDDEFINE»
+
+«DEFINE connectionAnchors FOR gmfgen::GenLink-»
+«EXPAND xpt::Common::generatedMemberComment»
+public org.eclipse.draw2d.ConnectionAnchor getSourceConnectionAnchor(org.eclipse.gef.ConnectionEditPart connection) {
+	return new org.eclipse.gmf.runtime.lite.figures.ConnectionConnectionAnchor(getConnectionFigure());
+}
+
+«EXPAND xpt::Common::generatedMemberComment»
+public org.eclipse.draw2d.ConnectionAnchor getSourceConnectionAnchor(org.eclipse.gef.Request request) {
+	return new org.eclipse.gmf.runtime.lite.figures.ConnectionConnectionAnchor(getConnectionFigure());
+}
+
+«EXPAND xpt::Common::generatedMemberComment»
+public org.eclipse.draw2d.ConnectionAnchor  getTargetConnectionAnchor(org.eclipse.gef.ConnectionEditPart connection) {
+	return new org.eclipse.gmf.runtime.lite.figures.ConnectionConnectionAnchor(getConnectionFigure());
+}
+
+«EXPAND xpt::Common::generatedMemberComment»
+public org.eclipse.draw2d.ConnectionAnchor  getTargetConnectionAnchor(org.eclipse.gef.Request request) {
+	return new org.eclipse.gmf.runtime.lite.figures.ConnectionConnectionAnchor(getConnectionFigure());
+}
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenLink»«ENDDEFINE»
+