Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt
index d4f9b95f3..125017224 100644
--- a/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt
+++ b/plugins/org.eclipse.gmf.codegen/templates/xpt/providers/ElementTypes.xpt
@@ -48,6 +48,8 @@ public class «elementTypesClassName» extends ElementInitializers {
«EXPAND getElementType-»
«EXPAND isKnownElementType-»
+
+ «EXPAND getElementTypeByVisualID-»
«EXPAND additions-»
}
@@ -234,5 +236,20 @@ KNOWN_ELEMENT_TYPES.add(«getUniqueIdentifier()»);
«ENDIF-»
«ENDDEFINE»
+«DEFINE getElementTypeByVisualID FOR gmfgen::GenDiagram-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static org.eclipse.gmf.runtime.emf.type.core.IElementType getElementType(int visualID) {
+ switch (visualID) {
+ «EXPAND caseElementType FOREACH getElements().select(el | el.elementType != null)-»
+ }
+ return null;
+ }
+«ENDDEFINE»
+
+«DEFINE caseElementType FOR gmfgen::GenCommonBase-»
+ «EXPAND xpt::Common::caseVisualID-»
+ return «getUniqueIdentifier()»;
+«ENDDEFINE»
+
«DEFINE additions FOR gmfgen::GenDiagram-»
«ENDDEFINE» \ No newline at end of file

Back to the top