Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: bc3af93ea8fc1dc07f915d92e71bd4b24b5d3383 (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
/*
 * Copyright (c) 2006 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:
 *    Artem Tikhomirov (Borland) - initial API and implementation
 */

«IMPORT "http://www.eclipse.org/gmf/2005/GraphicalDefinition"»
«IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
«EXTENSION Util»

«DEFINE CreateChildren FOR gmfgraph::Figure-»
	/**
	 * @generated
	 */
	private void createContents(){
«EXPAND instantiate(0, this, "this") FOREACH children.typeSelect(gmfgraph::Figure)»
	}
«EXPAND accessors FOREACH children.typeSelect(gmfgraph::Figure)»
«ENDDEFINE»

«DEFINE instantiate(EInt count, gmfgraph::Figure parentFigure, String parentFigureVariable) FOR gmfgraph::FigureMarker»
«ERROR "Placeholder, though should never get here as long as there\'s typeSelect above"»
«ENDDEFINE»

«DEFINE accessors FOR gmfgraph::FigureMarker»
«ERROR "Placeholder, though should never get here as long as there\'s typeSelect above"»
«ENDDEFINE»

«DEFINE instantiate(EInt count, gmfgraph::Figure parentFigure, EString parentFigureVariable) FOR gmfgraph::Figure»
«LET figureVariableName(count) AS figureVarName»
«EXPAND newFigureInstance(figureVarName)-»
«EXPAND Attrs::Init(figureVarName)-»
«IF null == layoutData || null == parentFigure.layout-»«REM»Check for (parentLayout != null) to avoid generating data that won't be used. Not sure it's essential, but it was that way with old jet templates«ENDREM»
«parentFigureVariable».add(«figureVarName»);
«ELSE-»
«EXPAND LayoutData::Init(parentFigureVariable, figureVarName) FOR layoutData-»
«ENDIF-»
«IF !referencingElements.isEmpty()»«figureFieldSetter()»(«figureVarName»);«ENDIF-»
«EXPAND Layout::Init(figureVarName) FOR layout-»
«EXPAND instantiate(count + 1, this, figureVarName) FOREACH children.typeSelect(gmfgraph::Figure)-»
«ENDLET»
«ENDDEFINE»

«DEFINE newFigureInstance(String figureVarName) FOR gmfgraph::Figure»
«qualifiedClassNameGEF()» «figureVarName» = new «qualifiedClassNameGEF()»();
«ENDDEFINE»

«DEFINE newFigureInstance(String figureVarName) FOR gmfgraph::ScalablePolygon»
«LET figureVarName.toFirstUpper() + "Class" AS localClassName-»
class «localClassName» extends «qualifiedClassNameGEF()» {
«EXPAND xtras::ScalablePolygon::behaviour-»
};
«localClassName» «figureVarName» = new «localClassName»();
«ENDLET-»
«ENDDEFINE»

«DEFINE accessors FOR gmfgraph::Figure-»
«IF !referencingElements.isEmpty()-»
	/**
	 * @generated
	 */
	private «qualifiedClassNameGEF()» «figureFieldName()»; 

	/**
	 * @generated
	 */
	public «qualifiedClassNameGEF()» «figureFieldGetter()»() {
		return «figureFieldName()»;
	}
	
	/**
	 * @generated
	 */
	private void «figureFieldSetter()»(«qualifiedClassNameGEF()» fig){
		«figureFieldName()» = fig;
	}
«ENDIF-»
«EXPAND accessors FOREACH children.typeSelect(gmfgraph::Figure)»
«ENDDEFINE»

Back to the top