carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/preferences/Util.ext
changeset 422 033392511bf7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/carbidecpp22devenv/plugins/org.eclipse.gmf.templates.legacy_1.0.0.v20090614-0839/codegen.lite.templates/xpt/diagram/preferences/Util.ext	Fri Dec 04 11:06:59 2009 -0600
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2007 Borland Software Corp.
+ * 
+ * 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:
+ *    bblajer (Borland) - initial API and implementation
+ */
+
+import "http://www.eclipse.org/gmf/2008/GenModel";
+import "http://www.eclipse.org/emf/2002/Ecore";
+
+Boolean hasSupportedPreferencePages(Collection[gmfgen::GenPreferencePage] pages) :
+	pages.exists(e| e.isSupported() || e.children.hasSupportedPreferencePages())
+;
+
+//TODO: support more page types
+Boolean isSupported(gmfgen::GenPreferencePage page) :
+	false
+;
+
+Boolean isSupported(gmfgen::GenCustomPreferencePage page) :
+	true
+;
+
+Boolean isSupported(gmfgen::GenStandardPreferencePage page) :
+	gmfgen::StandardPreferencePages::Appearance.value == page.kind.value ||
+	gmfgen::StandardPreferencePages::General.value == page.kind.value
+;
+
+Boolean hasPreferencePagesWithInitializers(Collection[gmfgen::GenPreferencePage] pages) :
+	pages.exists(e| e.hasInitializer() || e.children.hasPreferencePagesWithInitializers())
+;
+
+Boolean hasInitializer(gmfgen::GenPreferencePage page) :
+	false
+;
+
+Boolean hasInitializer(gmfgen::GenStandardPreferencePage page) :
+	//All standard preference pages are initialized in the same way
+	page.isSupported()
+;
+