diff options
Diffstat (limited to 'plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/editor/CreationWizardPage.xpt')
-rw-r--r-- | plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/editor/CreationWizardPage.xpt | 108 |
1 files changed, 0 insertions, 108 deletions
diff --git a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/editor/CreationWizardPage.xpt b/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/editor/CreationWizardPage.xpt deleted file mode 100644 index ca29be1d752..00000000000 --- a/plugins/toolsmiths/gmf-tooling/org.eclipse.papyrus.gmf.codegen/templates/xpt/editor/CreationWizardPage.xpt +++ /dev/null @@ -1,108 +0,0 @@ -/****************************************************************************** - * Copyright (c) 2007, 2020 Borland Software Corporation, CEA LIST, Artal - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License 2.0 - * which accompanies this distribution, and is available at - * https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - * - * Contributors: - * Dmitry Stadnik (Borland) - initial API and implementation - * Aurelien Didier (ARTAL) - aurelien.didier51@gmail.com - Bug 569174 - *****************************************************************************/ -«IMPORT 'http://www.eclipse.org/papyrus/gmf/2020/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» |