Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorashatalin2008-12-29 07:41:38 -0500
committerashatalin2008-12-29 07:41:38 -0500
commitfc1dfb3b462e159eec1b6031bb41ab79c762474b (patch)
tree66acb7873f68640147106dcd919a5041ecbc918b /plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences
parent7f3bb1960b122d5d9c4edae8dc1c330032c9cf60 (diff)
downloadorg.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.gz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.tar.xz
org.eclipse.gmf-tooling-fc1dfb3b462e159eec1b6031bb41ab79c762474b.zip
QVTO-based xpand implementation was merged to HEAD
Diffstat (limited to 'plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/CustomPage.xpt84
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/StandardPage.xpt46
2 files changed, 130 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/CustomPage.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/CustomPage.xpt
new file mode 100644
index 000000000..dea3c3246
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/CustomPage.xpt
@@ -0,0 +1,84 @@
+/*
+ * Copyright (c) 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:
+ * Artem Tikhomirov (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
+«EXTENSION xpt::StringOperations»
+
+«DEFINE Main FOR gmfgen::GenCustomPreferencePage-»
+«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
+package «(if qualifiedClassName = getClassName() then getDiagram().preferencesPackageName else qualifiedClassName.substring(1 + 0, qualifiedClassName.xpandLength() - getClassName().xpandLength() - 1) endif)»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «getClassName()»«EXPAND extendsList»«EXPAND implementsList» {
+
+«EXPAND _constant FOREACH preferences-»
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public «getClassName()»() {
+ setPreferenceStore(«getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore());
+ }
+«EXPAND methods»
+«EXPAND initDefaultsMethod»
+«EXPAND additions»
+}
+«ENDDEFINE»
+
+«DEFINE extendsList FOR gmfgen::GenCustomPreferencePage» extends org.eclipse.gmf.runtime.common.ui.preferences.AbstractPreferencePage«ENDDEFINE»
+«DEFINE implementsList FOR gmfgen::GenCustomPreferencePage»«REM»no-op«ENDREM»«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenCustomPreferencePage»«ENDDEFINE»
+
+// the reason I didn't split this template up into two distinct, addFieldsMethod and initHelpMethod, is that
+// using superclass other than oe.gmf...AbstractPreferencePage may require implementation of completely different
+// set of methods. Besides, there's not to much generated, anyway.
+«DEFINE methods FOR gmfgen::GenCustomPreferencePage»
+ «EXPAND xpt::Common::generatedMemberComment»
+ protected void addFields(org.eclipse.swt.widgets.Composite parent) {
+ // TODO Provide method implementation
+ throw new UnsupportedOperationException();
+ }
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ protected void initHelp() {
+ // TODO implement this method if needed, or leave as no-op
+ }
+«ENDDEFINE»
+
+
+«DEFINE initDefaultsMethod FOR gmfgen::GenCustomPreferencePage-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static void initDefaults(org.eclipse.jface.preference.IPreferenceStore store) {
+«IF preferences->isEmpty() or preferences->exists(p | p.defaultValue = null)-»
+ // TODO this code is invoked during preference store initialization, please fill
+ // the store passed with default preference values.
+«ENDIF-»
+«EXPAND _setDefaultValue('store') FOREACH preferences->select(p | p.defaultValue <> null)-»
+ }
+«ENDDEFINE»
+
+// pair template to initDefaultsMethod, allows external templates invoke generated initDefaults method
+// Note, CustomPage::Main is expected to be invoked only for templates with generateBoilerplate == true,
+// hence no extra check when generating with initDefaultsMethod,
+// however, call_initDefaults may get invoked for any CustomPreferencePage
+«DEFINE call_initDefaults(storeVarName : String) FOR gmfgen::GenCustomPreferencePage-»
+«IF generateBoilerplate»«qualifiedClassName».initDefaults(«storeVarName»);«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE _constant FOR gmfgen::GenPreference-»
+ «EXPAND xpt::Common::generatedMemberComment»
+ public static final String «name» = "«key»";«EXPAND xpt::Common::nonNLS»
+«ENDDEFINE»
+
+«DEFINE _setDefaultValue(store : String) FOR gmfgen::GenPreference-»
+ «store».setDefault(«name», «defaultValue»);
+«ENDDEFINE» \ No newline at end of file
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/StandardPage.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/StandardPage.xpt
new file mode 100644
index 000000000..3a27cb938
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/impl/preferences/StandardPage.xpt
@@ -0,0 +1,46 @@
+/*
+ * Copyright (c) 2006, 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ */
+
+«IMPORT 'http://www.eclipse.org/gmf/2008/GenModel'»
+«IMPORT 'http://www.eclipse.org/emf/2002/Ecore'»
+
+«DEFINE Main FOR gmfgen::GenStandardPreferencePage-»
+«EXPAND xpt::Common::copyright FOR getDiagram().editorGen-»
+package «getDiagram().preferencesPackageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «getClassName()»«EXPAND extendsList»«EXPAND implementsList» {
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public «getClassName()»() {
+ setPreferenceStore(«getDiagram().editorGen.plugin.getActivatorQualifiedClassName()».getInstance().getPreferenceStore());
+ }
+}
+«ENDDEFINE»
+
+«DEFINE extendsList FOR gmfgen::GenStandardPreferencePage-»
+«IF gmfgen::StandardPreferencePages::General = kind-»
+ extends org.eclipse.gmf.runtime.diagram.ui.preferences.DiagramsPreferencePage«-»
+«ELSEIF gmfgen::StandardPreferencePages::Appearance = kind-»
+ extends org.eclipse.gmf.runtime.diagram.ui.preferences.AppearancePreferencePage«-»
+«ELSEIF gmfgen::StandardPreferencePages::Connections = kind-»
+ extends org.eclipse.gmf.runtime.diagram.ui.preferences.ConnectionsPreferencePage«-»
+«ELSEIF gmfgen::StandardPreferencePages::Printing = kind-»
+ extends org.eclipse.gmf.runtime.diagram.ui.preferences.PrintingPreferencePage«-»
+«ELSEIF gmfgen::StandardPreferencePages::RulersAndGrid = kind-»
+ extends org.eclipse.gmf.runtime.diagram.ui.preferences.RulerGridPreferencePage«-»
+«ENDIF-»
+«ENDDEFINE»
+
+«DEFINE implementsList FOR gmfgen::GenStandardPreferencePage»«REM»no-op«ENDREM»«ENDDEFINE»
+
+«DEFINE call_initDefaults(storeVarName : String) FOR gmfgen::GenStandardPreferencePage»«IF kind <> gmfgen::StandardPreferencePages::Pathmaps»«getQualifiedClassName()».initDefaults(«storeVarName»);«ENDIF»«ENDDEFINE» \ No newline at end of file

Back to the top