Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/Metrics.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/Metrics.qvto26
1 files changed, 26 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/Metrics.qvto b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/Metrics.qvto
new file mode 100644
index 000000000..5b8868b63
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/providers/Metrics.qvto
@@ -0,0 +1,26 @@
+import xpt.providers.NativeMetrics;
+
+modeltype genModel uses "http://www.eclipse.org/gmf/2008/GenModel";
+
+library Metrics;
+
+helper getNotationMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
+ return c.metrics->select(m | not (Sequence { m.target })[genModel::GenNotationElementTarget]->isEmpty())->asSequence()
+}
+
+helper getDiagramMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
+ return c.metrics->select(m | not (Sequence { m.target })[genModel::GenDiagramElementTarget]->isEmpty())->asSequence()
+}
+
+helper getDomainMetrics(c : genModel::GenMetricContainer) : Sequence(genModel::GenMetricRule) {
+ return c.metrics->select(m | not (Sequence { m.target })[genModel::GenDomainElementTarget]->isEmpty())->asSequence()
+}
+
+helper exprFieldName(m : genModel::GenMetricRule) : String {
+ return 'expression' + validJavaIdentifier(m.key).firstToUpper()
+}
+
+helper calcMethodName(m : genModel::GenMetricRule) : String {
+ return 'calc' + validJavaIdentifier(m.key).firstToUpper()
+}
+

Back to the top