Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e22ca8a8ca56035b52a9ba7c8f875cbc20ba0575 (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
/*
 * Copyright (c) 2007 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/2006/GraphicalDefinition'»
«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
«EXTENSION Util»
«EXTENSION xpt::StringOperations»

«DEFINE Top(packageStmt : String) FOR gmfgraph::FigureDescriptor»
«IF packageStmt <> null and packageStmt.xpandLength() > 0»package «packageStmt»;
«ENDIF-»
/**
 * @generated
 */
public class «compilationUnitName(self)» extends «EXPAND Runtime::fqn FOR actualFigure» {
«EXPAND body»
«additionalStaticFields()»
}
«ENDDEFINE»



«DEFINE Inner FOR gmfgraph::FigureDescriptor»
/**
 * @generated
 */
public class «compilationUnitName(self)» extends «EXPAND Runtime::fqn FOR actualFigure» {
«EXPAND body»
}
«additionalStaticFields()»
«ENDDEFINE»

«REM»«ENDREM»
«DEFINE body FOR gmfgraph::FigureDescriptor»

«EXPAND accessorField FOREACH accessors->select(a | not (allCustomAccessors(self).typedFigure)[gmfgraph::Figure]->includes(a.figure))»

«EXPAND Figure::ClassBody(compilationUnitName(self)) FOR actualFigure»

«EXPAND accessorToField FOREACH accessors->select(a | not (allCustomAccessors(self).typedFigure)[gmfgraph::Figure]->includes(a.figure))»
«FOREACH accessors->select(a | (allCustomAccessors(self).typedFigure)[gmfgraph::Figure]->includes(a.figure))->asSequence() AS a-»
«EXPAND accessorToCustom(allCustomAccessors(self)->select(fa | fa.typedFigure = a.figure)) FOR a»
«ENDFOREACH-»
«ENDDEFINE»


«DEFINE accessorField FOR gmfgraph::ChildAccess-»
	/**
	 * @generated
	 */
	private «EXPAND Runtime::fqn FOR figure» «self.figureFieldName()»; 
«ENDDEFINE»

«REM»ChildAccess points to figure we've generated, there's a field for it«ENDREM»
«DEFINE accessorToField FOR gmfgraph::ChildAccess-»
	/**
	 * @generated
	 */
	public «EXPAND Runtime::fqn FOR figure» «accessor»() {
		return «self.figureFieldName()»;
	}
«ENDDEFINE»

«REM»ChildAccess points to some child of a CustomFigure, need to delegate to it's accessor
Perhaps, should add support for ChildAccess not being generated (in case they are have same name as 
FigureAccessor.accessor
«ENDREM»
«DEFINE accessorToCustom(fa : Sequence(gmfgraph::FigureAccessor)) FOR gmfgraph::ChildAccess-»
	/**
	 * @generated
	 */
	public «EXPAND Runtime::fqn FOR figure» «accessor»() {
		return «fa.accessor->first()»;
	}
«ENDDEFINE»

Back to the top