Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt68
1 files changed, 68 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt
new file mode 100644
index 000000000..764aace1f
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/diagram/editpolicies/LinkItemSemanticEditPolicy.xpt
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2007, 2008 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:
+ * Alexander Shatalin (Borland) - initial API and implementation
+ * Michael Golubev (Borland) - [243151] explicit source/target for links
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«EXTENSION xpt::GenModelUtils»
+«EXTENSION xpt::diagram::editpolicies::LinkUtils»
+
+«DEFINE LinkItemSemanticEditPolicy FOR gmfgen::GenLink-»
+ «EXPAND xpt::Common::copyright FOR diagram.editorGen-»
+package «getDiagram().editPoliciesPackageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «itemSemanticEditPolicyClassName» extends «diagram.getBaseItemSemanticEditPolicyQualifiedClassName()» {
+
+ «EXPAND xpt::diagram::editpolicies::BaseItemSemanticEditPolicy::defaultConstructor-»
+
+ «EXPAND classBody-»
+
+ «EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE classBody FOR gmfgen::GenLink-»
+ «EXPAND getDestroySemanticCommand FOR modelFacet -»
+ «IF isTypeLink(self)-»
+ «EXPAND xpt::diagram::editpolicies::linkCommands::linkCommands -»
+ «ENDIF-»
+«ENDDEFINE»
+
+«DEFINE getDestroySemanticCommand FOR gmfgen::LinkModelFacet-»
+ «ERROR 'Unsupported model facet: ' + self.repr()-»
+«ENDDEFINE»
+
+«DEFINE getDestroySemanticCommand FOR gmfgen::FeatureLinkModelFacet-»
+ «EXPAND xpt::Common::generatedMemberComment»
+protected org.eclipse.gef.commands.Command getDestroyReferenceCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyReferenceRequest req) {
+ return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyReferenceCommand(req)«IF isContains(metaFeature)» {
+
+ protected org.eclipse.gmf.runtime.common.core.command.CommandResult doExecuteWithResult(org.eclipse.core.runtime.IProgressMonitor progressMonitor, org.eclipse.core.runtime.IAdaptable info) throws org.eclipse.core.commands.ExecutionException {
+ org.eclipse.emf.ecore.EObject referencedObject = getReferencedObject();
+ org.eclipse.emf.ecore.resource.Resource resource = referencedObject.eResource();
+ org.eclipse.gmf.runtime.common.core.command.CommandResult result = super.doExecuteWithResult(progressMonitor, info);
+ resource.getContents().add(referencedObject);
+ return result;
+ }
+
+ }«ENDIF»);
+}
+«ENDDEFINE»
+
+«DEFINE getDestroySemanticCommand FOR gmfgen::TypeLinkModelFacet-»
+ «EXPAND xpt::Common::generatedMemberComment»
+protected org.eclipse.gef.commands.Command getDestroyElementCommand(org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest req) {
+ return getGEFWrapper(new org.eclipse.gmf.runtime.emf.type.core.commands.DestroyElementCommand(req));
+}
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenLink»«ENDDEFINE» \ No newline at end of file

Back to the top