Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: d79b500c2aea8c716a32ff054971577616ebc083 (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
108
109
110
111
112
/**
 * Copyright (c) 2006, 2009, 2013 Borland Software Corporation and others
 * 
 * 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
 *    Michael Golubev (Montages) - #386838 - migrate to Xtend2
 */
package aspects.diagram.editparts

import com.google.inject.Inject
import com.google.inject.Singleton
import org.eclipse.gmf.codegen.gmfgen.GenNode
import xpt.Common
import xpt.diagram.editparts.Utils_qvto

//DOCUMENTATION: PapyrusGenCode
//add call template in order to generate handlenotification in order to refresh figure by taking account event

@Singleton class NodeEditPart extends diagram.editparts.NodeEditPart {
	@Inject extension Common;
	@Inject extension Utils_qvto;
	
	@Inject impl.diagram.editparts.NodeEditPart xptNodeEditPartImpl;
	@Inject aspects.impl.diagram.editparts.NodeEditPart aspectsNodeEditPartImpl;
	

	
	override Main(GenNode it) '''
	«copyright(diagram.editorGen)»
	package «xptNodeEditPartImpl.packageName(it)»;
	
	«generatedClassComment»
	public class «xptNodeEditPartImpl.className(it)» «extendsList(it)» «implementsList(it)» {
	
		«attributes(it)»
		
		«xptNodeEditPartImpl.constructor(it)»
		
		«createDefaultEditPolicies(it)»
		
		«xptNodeEditPartImpl.createLayoutEditPolicy(it)»
		
«««	BEGIN: PapyrusGenCode
«««	call tamplate to paste code for refresh figure by taking account event
	«aspectsNodeEditPartImpl.specificHandleNotificationEvent(it)»
«««	END: PapyrusGenCode
		
		«xptNodeEditPartImpl.createNodeShape(it.viewmap, it)»
		
	«IF hasFixedChildren(it)»
		«xptNodeEditPartImpl.addFixedChild(it)»
	
		«xptNodeEditPartImpl.removeFixedChild(it)»
	
		«xptNodeEditPartImpl.addChildVisual(it)»
	
		«xptNodeEditPartImpl.removeChildVisual(it)»
	
		«xptNodeEditPartImpl.getContentPaneFor(it)»
	«ENDIF»
	
		«xptNodeEditPartImpl.addBorderItem(it)»
		
		«xptNodeEditPartImpl.createNodePlate(it)»
		
		«xptNodeEditPartImpl.getPrimaryDragEditPolicy(it)»
		
		«xptNodeEditPartImpl.createFigure(it)»
		
		«xptNodeEditPartImpl.setupContentPane(it)»
		
		«xptNodeEditPartImpl.getContentPane(it)»
	
		«xptNodeEditPartImpl.setForegroundColor(it)»
	
«««		«xptNodeEditPartImpl.setBackgroundColor(it)»
	
		«xptNodeEditPartImpl.setLineWidth(it)»
	
		«xptNodeEditPartImpl.setLineStyle(it)»
	
		«xptNodeEditPartImpl.getPrimaryChildEditPart(it)»
		

	
	«IF hasChildrenInListCompartments(it)»
		«xptNodeEditPartImpl.getTargetEditPartMethod(it)»
	«ENDIF»
	
		«handleNotificationEvent(it)»
	
		«xptNodeEditPartImpl.innerClassDeclaration(viewmap)»
		
		«additions(it)»
	}
	'''

	//BEGIN: PapyrusGenCode
	//patches the super type of the node edit part in case the controlled object represents a UML element
	override extendsList (GenNode it)''' extends «aspectsNodeEditPartImpl.extendsListContents(it)»'''
	//END: PapyrusGenCode

	//	override additions(GenNode it) '''
	//	«aspectsNodeEditPartImpl.genPreferredValue(it)»
	//	'''
}

Back to the top