carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.templates/xpt/providers/Metrics.ext
changeset 422 033392511bf7
equal deleted inserted replaced
421:631a44165bcf 422:033392511bf7
       
     1 /*
       
     2  * Copyright (c) 2008 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/2008/GenModel";
       
    14 import "http://www.eclipse.org/emf/2002/Ecore";
       
    15 
       
    16 cached List[GenMetricRule] getNotationMetrics(GenMetricContainer c) : c.metrics.select(m | !{ m.target }.typeSelect(GenNotationElementTarget).isEmpty()) ;
       
    17 cached List[GenMetricRule] getDiagramMetrics(GenMetricContainer c) : c.metrics.select(m | !{ m.target }.typeSelect(GenDiagramElementTarget).isEmpty()) ;
       
    18 cached List[GenMetricRule] getDomainMetrics(GenMetricContainer c) : c.metrics.select(m | !{ m.target }.typeSelect(GenDomainElementTarget).isEmpty()) ;
       
    19 
       
    20 String exprFieldName(GenMetricRule m) : "expression" + validJavaIdentifier(m.key).toFirstUpper() ;
       
    21 String calcMethodName(GenMetricRule m) : "calc" + validJavaIdentifier(m.key).toFirstUpper() ;
       
    22 
       
    23 //
       
    24 // CodeGenUtil#validJavaIdentifier()
       
    25 //
       
    26 String validJavaIdentifier(String identifier) :
       
    27 JAVA org.eclipse.emf.codegen.util.CodeGenUtil.validJavaIdentifier(java.lang.String)
       
    28 ;