Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/DomainModelElementTester.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/DomainModelElementTester.xpt50
1 files changed, 50 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/DomainModelElementTester.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/DomainModelElementTester.xpt
new file mode 100644
index 000000000..ee08817d7
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/DomainModelElementTester.xpt
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2007, 2008 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:
+ * Alexander Shatalin (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/GenModel'»
+«EXTENSION xpt::GenModelUtils»
+
+«DEFINE DomainModelElementTester FOR gmfgen::GenNavigator-»
+ «EXPAND xpt::Common::copyright FOR editorGen-»
+package «editorGen.editor.packageName»;
+
+ «EXPAND xpt::Common::generatedClassComment»
+public class «domainModelElementTesterClassName» extends org.eclipse.core.expressions.PropertyTester {
+
+ «EXPAND test-»
+
+ «EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE test FOR gmfgen::GenNavigator-»
+ «EXPAND xpt::Common::generatedMemberComment»
+public boolean test(Object receiver, String method, Object[] args, Object expectedValue) {
+ if (false == receiver instanceof org.eclipse.emf.ecore.EObject) {
+ return false;
+ }
+ org.eclipse.emf.ecore.EObject eObject = (org.eclipse.emf.ecore.EObject) receiver;
+ org.eclipse.emf.ecore.EClass eClass = eObject.eClass();
+ «EXPAND checkGenClass FOREACH editorGen.domainGenModel.genPackages.genClasses-»
+ return false;
+}
+«ENDDEFINE»
+
+«DEFINE checkGenClass FOR genmodel::GenClass-»
+if (eClass == «EXPAND MetaModel::MetaClass») {
+ return true;
+}
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenNavigator-»
+«ENDDEFINE» \ No newline at end of file

Back to the top