Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt61
1 files changed, 61 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt
new file mode 100644
index 000000000..a5502e08e
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/diagram/editparts/LinkLabelEditPart.xpt
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2006, 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ * Alexander Shatalin (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«EXTENSION xpt::diagram::ViewmapAttributesUtils»
+
+«DEFINE initializer FOR gmfgen::GenLinkLabel-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ static {
+ registerSnapBackPosition(«EXPAND xpt::editor::VisualIDRegistry::typeMethodCall»,
+ new org.eclipse.draw2d.geometry.Point(«labelOffsetX(viewmap, 0)», «labelOffsetY(viewmap, 0)»));
+ }
+«ENDDEFINE»
+
+«DEFINE _constructor FOR gmfgen::GenLinkLabel-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public «editPartClassName»(org.eclipse.gmf.runtime.notation.View view) {
+ super(view);
+ }
+«ENDDEFINE»
+
+«DEFINE createDefaultEditPoliciesBody FOR gmfgen::GenLinkLabel-»
+ super.createDefaultEditPolicies();
+ installEditPolicy(org.eclipse.gef.EditPolicy.DIRECT_EDIT_ROLE,
+ new org.eclipse.gmf.runtime.diagram.ui.editpolicies.LabelDirectEditPolicy());
+ installEditPolicy(org.eclipse.gef.EditPolicy.SELECTION_FEEDBACK_ROLE,
+ new «getDiagram().getTextSelectionEditPolicyQualifiedClassName()»());
+ installEditPolicy(org.eclipse.gef.EditPolicy.PRIMARY_DRAG_ROLE,
+ new org.eclipse.gmf.runtime.diagram.ui.editpolicies.NonResizableLabelEditPolicy() {
+
+ protected java.util.List createSelectionHandles() {
+ org.eclipse.gef.handles.MoveHandle mh = new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());
+ mh.setBorder(null);
+ return java.util.Collections.singletonList(mh);
+ }
+ });
+ «EXPAND xpt::diagram::editparts::Common::behaviour FOR self-»
+«ENDDEFINE»
+
+«DEFINE getKeyPoint FOR gmfgen::GenLinkLabel-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public int getKeyPoint() {
+ return org.eclipse.draw2d.ConnectionLocator.«alignment»;
+ }
+«ENDDEFINE»
+
+«DEFINE handleNotificationEventBody FOR gmfgen::GenLinkLabel-»
+ Object feature = event.getFeature();
+ «EXPAND xpt::diagram::editparts::Common::handleText FOR self-»
+ super.handleNotificationEvent(event);
+«ENDDEFINE» \ No newline at end of file

Back to the top