carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/graphdef.codegen.templates/top/Descriptor.xpt
changeset 422 033392511bf7
equal deleted inserted replaced
421:631a44165bcf 422:033392511bf7
       
     1 /*
       
     2  * Copyright (c) 2007 Borland Software Corporation
       
     3  * 
       
     4  * All rights reserved. This program and the accompanying materials
       
     5  * are made available under the terms of the Eclipse Public License v1.0
       
     6  * which accompanies this distribution, and is available at
       
     7  * http://www.eclipse.org/legal/epl-v10.html
       
     8  *
       
     9  * Contributors:
       
    10  *    Artem Tikhomirov (Borland) - initial API and implementation
       
    11  */
       
    12 
       
    13 «IMPORT "http://www.eclipse.org/gmf/2006/GraphicalDefinition"»
       
    14 «IMPORT "http://www.eclipse.org/emf/2002/Ecore"»
       
    15 «IMPORT "templates"»
       
    16 «EXTENSION Util»
       
    17 
       
    18 «DEFINE Top(String packageStmt) FOR gmfgraph::FigureDescriptor»
       
    19 «IF packageStmt != null && packageStmt.length() > 0»package «packageStmt»;
       
    20 «ENDIF-»
       
    21 /**
       
    22  * @generated
       
    23  */
       
    24 public class «compilationUnitName()» extends «EXPAND Runtime::fqn FOR actualFigure» {
       
    25 «EXPAND body»
       
    26 «additionalStaticFields()»
       
    27 }
       
    28 «ENDDEFINE»
       
    29 
       
    30 
       
    31 
       
    32 «DEFINE Inner FOR gmfgraph::FigureDescriptor»
       
    33 /**
       
    34  * @generated
       
    35  */
       
    36 public class «compilationUnitName()» extends «EXPAND Runtime::fqn FOR actualFigure» {
       
    37 «EXPAND body»
       
    38 }
       
    39 «additionalStaticFields()»
       
    40 «ENDDEFINE»
       
    41 
       
    42 «REM»«ENDREM»
       
    43 «DEFINE body FOR gmfgraph::FigureDescriptor»
       
    44 
       
    45 «EXPAND accessorField FOREACH accessors.select(a | !allCustomAccessors().typedFigure.contains(a.figure))»
       
    46 
       
    47 «EXPAND Figure::ClassBody(compilationUnitName()) FOR actualFigure»
       
    48 
       
    49 «EXPAND accessorToField FOREACH accessors.select(a | !allCustomAccessors().typedFigure.contains(a.figure))»
       
    50 «FOREACH accessors.select(a | allCustomAccessors().typedFigure.contains(a.figure)) AS a-»
       
    51 «EXPAND accessorToCustom(allCustomAccessors().select(fa | fa.typedFigure == a.figure)) FOR a»
       
    52 «ENDFOREACH-»
       
    53 «ENDDEFINE»
       
    54 
       
    55 
       
    56 «DEFINE accessorField FOR gmfgraph::ChildAccess-»
       
    57 	/**
       
    58 	 * @generated
       
    59 	 */
       
    60 	private «EXPAND Runtime::fqn FOR figure» «figureFieldName()»; 
       
    61 «ENDDEFINE»
       
    62 
       
    63 «REM»ChildAccess points to figure we've generated, there's a field for it«ENDREM»
       
    64 «DEFINE accessorToField FOR gmfgraph::ChildAccess-»
       
    65 	/**
       
    66 	 * @generated
       
    67 	 */
       
    68 	public «EXPAND Runtime::fqn FOR figure» «accessor»() {
       
    69 		return «figureFieldName()»;
       
    70 	}
       
    71 «ENDDEFINE»
       
    72 
       
    73 «REM»ChildAccess points to some child of a CustomFigure, need to delegate to it's accessor
       
    74 Perhaps, should add support for ChildAccess not being generated (in case they are have same name as 
       
    75 FigureAccessor.accessor
       
    76 «ENDREM»
       
    77 «DEFINE accessorToCustom(List[FigureAccessor] fa) FOR gmfgraph::ChildAccess-»
       
    78 	/**
       
    79 	 * @generated
       
    80 	 */
       
    81 	public «EXPAND Runtime::fqn FOR figure» «accessor»() {
       
    82 		return «fa.accessor.first()»;
       
    83 	}
       
    84 «ENDDEFINE»