Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/EnumUtils.qvto')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/EnumUtils.qvto17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/EnumUtils.qvto b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/EnumUtils.qvto
new file mode 100644
index 000000000..25e00b4ba
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates/impl/diagram/editparts/EnumUtils.qvto
@@ -0,0 +1,17 @@
+modeltype gmfgen uses "http://www.eclipse.org/gmf/2009/GenModel";
+modeltype ecore uses "http://www.eclipse.org/emf/2002/Ecore";
+
+library Utils;
+
+helper isEnumLabel(modelFacet : gmfgen::LabelModelFacet) : Boolean {
+ return modelFacet.parser.oclIsKindOf(gmfgen::PredefinedEnumParser);
+}
+
+helper getDirectManagerFQN(modelFacet : gmfgen::LabelModelFacet) : String {
+ return
+ (if isEnumLabel(modelFacet) then
+ 'org.eclipse.gmf.runtime.diagram.ui.tools.ComboDirectEditManager'
+ else
+ 'org.eclipse.gmf.runtime.diagram.ui.tools.TextDirectEditManager'
+ endif);
+} \ No newline at end of file

Back to the top