Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 3ee0d445d08dd36a76400a1aa6b5d742563e6cb0 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
/*
 * Copyright (c) 2006, 2009 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
 */
«REM»DOCUMENTATION: PapyrusGenCode«ENDREM»
«REM»add in the addition codes in order to refresh the labels«ENDREM»
«IMPORT 'http://www.eclipse.org/gmf/2009/GenModel'»
«EXTENSION xpt::diagram::editparts::Utils»

«DEFINE Main FOR gmfgen::GenNodeLabel-»
«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
package «getDiagram().editPartsPackageName»;

«EXPAND xpt::Common::generatedClassComment»
public class «editPartClassName» «EXPAND extendsList» «EXPAND implementsList» {

	«EXPAND attributes-»
	
	«EXPAND impl::diagram::editparts::NodeLabelEditPart::_constructor-»
	
	«EXPAND createDefaultEditPolicies-»
	
	«EXPAND impl::diagram::editparts::TextAware::methods(isStoringChildPositions(node), readOnly, elementIcon, viewmap, modelFacet, node, getDiagram())-»

	«EXPAND xpt::diagram::editparts::Common::notationalListeners-»
	
	«EXPAND impl::diagram::editparts::NodeLabelEditPart::refreshBounds-»
	
	«EXPAND handleNotificationEvent-»
	
	«EXPAND xpt::diagram::editparts::Common::labelFigure FOR viewmap-»
	
	«EXPAND additions-»
}
«ENDDEFINE»

«REM»BEGIN: PapyrusGenCode«ENDREM»
«REM»Definition of the inheritance«ENDREM»
«DEFINE extendsList FOR gmfgen::GenNodeLabel»extends org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusCompartmentEditPart«ENDDEFINE»
«REM»END: PapyrusGenCode«ENDREM»

«DEFINE implementsList FOR gmfgen::GenNodeLabel»implements org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart«ENDDEFINE»

«DEFINE attributes FOR gmfgen::GenNodeLabel-»
	«EXPAND xpt::diagram::editparts::Common::visualIDConstant FOR self-»

	«EXPAND impl::diagram::editparts::TextAware::fields FOR self-»
«ENDDEFINE»

«DEFINE createDefaultEditPolicies FOR gmfgen::GenNodeLabel-»
	«EXPAND xpt::Common::generatedMemberComment»
	protected void createDefaultEditPolicies() {
		«EXPAND impl::diagram::editparts::NodeLabelEditPart::createDefaultEditPoliciesBody-»
	}
«ENDDEFINE»

«DEFINE handleNotificationEvent FOR gmfgen::GenNodeLabel-»
	«EXPAND xpt::Common::generatedMemberComment»
	protected void handleNotificationEvent(org.eclipse.emf.common.notify.Notification event) {
		refreshLabel();
		«EXPAND impl::diagram::editparts::NodeLabelEditPart::handleNotificationEventBody-»
	}
«ENDDEFINE»

«DEFINE additions FOR gmfgen::GenNodeLabel-»
«REM»Code to refresh icon«ENDREM»

«EXPAND xpt::Common::generatedMemberComment»
private static final String ADD_PARENT_MODEL = "AddParentModel";

	
«EXPAND xpt::Common::generatedMemberComment»
	public void activate() {
		super.activate();
		addOwnerElementListeners();
	}

	«EXPAND xpt::Common::generatedMemberComment»
	protected void addOwnerElementListeners() {
		addListenerFilter(ADD_PARENT_MODEL, this, ((org.eclipse.gmf.runtime.notation.View) getParent().getModel())); //$NON-NLS-1$

	}

	«EXPAND xpt::Common::generatedMemberComment»
	public void deactivate() {
		removeOwnerElementListeners();
		super.deactivate();

	}


	«EXPAND xpt::Common::generatedMemberComment»
	protected void removeOwnerElementListeners() {
		removeListenerFilter(ADD_PARENT_MODEL);

	}

«REM»END: PapyrusGenCode«ENDREM»
«ENDDEFINE»

Back to the top