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/xpt/editor/CreationWizardPage.xpt
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/xpt/editor/CreationWizardPage.xpt')
-rw-r--r--plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/CreationWizardPage.xpt105
1 files changed, 105 insertions, 0 deletions
diff --git a/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/CreationWizardPage.xpt b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/CreationWizardPage.xpt
new file mode 100644
index 000000000..ef872708e
--- /dev/null
+++ b/plugins/org.eclipse.gmf.codegen/templates.migrated/xpt/editor/CreationWizardPage.xpt
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2007 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'»
+
+«EXTENSION xpt::editor::Utils»
+
+«DEFINE CreationWizardPage FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Common::copyright FOR editorGen-»
+package «editorGen.editor.packageName»;
+
+«EXPAND xpt::Common::generatedClassComment»
+public class «creationWizardPageClassName» extends
+ «IF editorGen.application = null-»
+ org.eclipse.ui.dialogs.WizardNewFileCreationPage
+ «ELSE-»
+ «editorGen.application.packageName».WizardNewFileCreationPage
+ «ENDIF-»
+ {
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ private final String fileExtension;
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public «creationWizardPageClassName»(String pageName,
+ org.eclipse.jface.viewers.IStructuredSelection selection, String fileExtension) {
+ super(pageName, selection);
+ this.fileExtension = fileExtension;
+ }
+
+ /**
+ * Override to create files with this extension.
+ *
+ * @generated
+ */
+ protected String getExtension() {
+ return fileExtension;
+ }
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public org.eclipse.emf.common.util.URI getURI() {
+ «IF editorGen.application = null-»
+ return org.eclipse.emf.common.util.URI.createPlatformResourceURI(getFilePath().toString(), false);
+ «ELSE-»
+ return org.eclipse.emf.common.util.URI.createFileURI(getFilePath().toString());
+ «ENDIF-»
+ }
+ «IF editorGen.application = null-»
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ protected org.eclipse.core.runtime.IPath getFilePath() {
+ org.eclipse.core.runtime.IPath path = getContainerFullPath();
+ if (path == null) {
+ path = new org.eclipse.core.runtime.Path(""); //$NON-NLS-1$
+ }
+ String fileName = getFileName();
+ if (fileName != null) {
+ path = path.append(fileName);
+ }
+ return path;
+ }
+ «ENDIF-»
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ public void createControl(org.eclipse.swt.widgets.Composite parent) {
+ super.createControl(parent);
+ setFileName(«getDiagramEditorUtilQualifiedClassName()».getUniqueFileName(
+ getContainerFullPath(), getFileName(), getExtension()));
+ setPageComplete(validatePage());
+ }
+
+ «EXPAND xpt::Common::generatedMemberComment»
+ protected boolean validatePage() {
+ if (!super.validatePage()) {
+ return false;
+ }
+ String extension = getExtension();
+ if (extension != null && !getFilePath().toString().endsWith("." + extension)) {
+ setErrorMessage(org.eclipse.osgi.util.NLS.bind(
+ «EXPAND xpt::Externalizer::accessorCall(i18nKeyForCreationWizardPageExtensionError(self)) FOR editorGen», extension));
+ return false;
+ }
+ return true;
+ }
+ «EXPAND additions-»
+}
+«ENDDEFINE»
+
+«DEFINE additions FOR gmfgen::GenDiagram»«ENDDEFINE»
+
+«DEFINE i18nValues FOR gmfgen::GenDiagram-»
+«EXPAND xpt::Externalizer::messageEntry(i18nKeyForCreationWizardPageExtensionError(self), 'File name should have {0} extension.')-»
+«ENDDEFINE»
+
+«DEFINE i18nAccessors FOR gmfgen::GenDiagram-»
+ «EXPAND xpt::Externalizer::accessorField(i18nKeyForCreationWizardPageExtensionError(self))-»
+«ENDDEFINE»

Back to the top