Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 0c86f57f46591ce03390ac24d10819f4e55958a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/******************************************************************************
 * Copyright (c) 2006, 2020 Borland Software Corporation, CEA LIST, Artal and others
 * 
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License 2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/legal/epl-2.0/ 
 * 
 * SPDX-License-Identifier: EPL-2.0
 *
 * Contributors: 
 *    Dmitry Stadnik (Borland) - initial API and implementation
 *    Alexander Shatalin (Borland) - initial API and implementation
 *    Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174
 *****************************************************************************/

«IMPORT 'http://www.eclipse.org/papyrus/gmf/2020/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 «EXPAND linkLabelDragPolicyQualifiedClassName FOR self.getDiagram()»());
	«EXPAND xpt::diagram::editparts::Common::behaviour FOR self-»
	«EXPAND additionalEditPolicies-»
«ENDDEFINE»

«DEFINE additionalEditPolicies FOR gmfgen::GenLinkLabel»«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»

«REM»since 3.1, old generated NodeLabelDragPolicy extracted to GMFT-runtime, 
see org.eclipse.gmf.tooling.runtime.edit.policies.DefaultNodeLabelDragPolicy.
The next 2 DEFINE's are left here as a hook for backward compatibility with possible AROUND's
«ENDREM» 
«DEFINE linkLabelDragPolicyQualifiedClassName FOR gmfgen::GenDiagram»org.eclipse.gmf.tooling.runtime.edit.policies.DefaultLinkLabelDragPolicy«ENDDEFINE»
«DEFINE linkLabelDragPolicyClass FOR gmfgen::GenDiagram»
«REM»not generated by default anymore«ENDREM»«-»
«ENDDEFINE»

Back to the top