Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/Children.xpt')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/Children.xpt86
1 files changed, 86 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/Children.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Children.xpt
new file mode 100644
index 000000000..bc3af93ea
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/Children.xpt
@@ -0,0 +1,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