carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/graphdef.codegen.templates/top/Descriptor.xpt
/*
* 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"»
«IMPORT "templates"»
«EXTENSION Util»
«DEFINE Top(String packageStmt) FOR gmfgraph::FigureDescriptor»
«IF packageStmt != null && packageStmt.length() > 0»package «packageStmt»;
«ENDIF-»
/**
* @generated
*/
public class «compilationUnitName()» extends «EXPAND Runtime::fqn FOR actualFigure» {
«EXPAND body»
«additionalStaticFields()»
}
«ENDDEFINE»
«DEFINE Inner FOR gmfgraph::FigureDescriptor»
/**
* @generated
*/
public class «compilationUnitName()» extends «EXPAND Runtime::fqn FOR actualFigure» {
«EXPAND body»
}
«additionalStaticFields()»
«ENDDEFINE»
«REM»«ENDREM»
«DEFINE body FOR gmfgraph::FigureDescriptor»
«EXPAND accessorField FOREACH accessors.select(a | !allCustomAccessors().typedFigure.contains(a.figure))»
«EXPAND Figure::ClassBody(compilationUnitName()) FOR actualFigure»
«EXPAND accessorToField FOREACH accessors.select(a | !allCustomAccessors().typedFigure.contains(a.figure))»
«FOREACH accessors.select(a | allCustomAccessors().typedFigure.contains(a.figure)) AS a-»
«EXPAND accessorToCustom(allCustomAccessors().select(fa | fa.typedFigure == a.figure)) FOR a»
«ENDFOREACH-»
«ENDDEFINE»
«DEFINE accessorField FOR gmfgraph::ChildAccess-»
/**
* @generated
*/
private «EXPAND Runtime::fqn FOR figure» «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 «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(List[FigureAccessor] fa) FOR gmfgraph::ChildAccess-»
/**
* @generated
*/
public «EXPAND Runtime::fqn FOR figure» «accessor»() {
return «fa.accessor.first()»;
}
«ENDDEFINE»