Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 40cd8507bb49daa462109e26d10ffad7a39cb10b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*
 * Copyright (c) 2008, 2009 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 org.eclipse.gmf.internal.codegen.util.CodeGenerationUtils;

modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";

library Metrics;

-- MODIFIERS: cached
helper getNotationMetrics(c : gmfgen::GenMetricContainer) : Sequence(gmfgen::GenMetricRule) {
	return c.metrics->select(target.oclIsKindOf(gmfgen::GenNotationElementTarget))
}

-- MODIFIERS: cached
helper getDiagramMetrics(c : gmfgen::GenMetricContainer) : Sequence(gmfgen::GenMetricRule) {
	return c.metrics->select(target.oclIsKindOf(gmfgen::GenDiagramElementTarget))
}

-- MODIFIERS: cached
helper getDomainMetrics(c : gmfgen::GenMetricContainer) : Sequence(gmfgen::GenMetricRule) {
	return c.metrics->select(target.oclIsKindOf(gmfgen::GenDomainElementTarget))
}

helper exprFieldName(m : gmfgen::GenMetricRule) : String {
	return 'expression' + validJavaIdentifier(m.key).firstToUpper()
}

helper calcMethodName(m : gmfgen::GenMetricRule) : String {
	return 'calc' + validJavaIdentifier(m.key).firstToUpper()
}

Back to the top