Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Descriptor.xpt')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Descriptor.xpt84
1 files changed, 84 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Descriptor.xpt b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Descriptor.xpt
new file mode 100644
index 000000000..e22ca8a8c
--- /dev/null
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/templates/top/Descriptor.xpt
@@ -0,0 +1,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» \ No newline at end of file

Back to the top