| /* |
| * Copyright (c) 2007, 2010 Borland Software Corporation and others |
| * |
| * 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'» |
| |
| «EXTENSION Util» |
| |
| «DEFINE Top(packageStmt : String) FOR gmfgraph::FigureDescriptor» |
| «IF packageStmt <> null and packageStmt.size() > 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» |