diff options
author | Florian Noyrit | 2014-04-07 18:13:29 +0000 |
---|---|---|
committer | Florian Noyrit | 2014-04-07 18:43:36 +0000 |
commit | 8180e2696df6b0702ae516060667e692c1cd2015 (patch) | |
tree | 272257459c131ac3d15680eb18f5051d00513584 /plugins/developer/org.eclipse.papyrus.def/xtend-gen | |
parent | 8cd208b6f08d93ab54320ce25a500fe519d4fdf1 (diff) | |
download | org.eclipse.papyrus-8180e2696df6b0702ae516060667e692c1cd2015.tar.gz org.eclipse.papyrus-8180e2696df6b0702ae516060667e692c1cd2015.tar.xz org.eclipse.papyrus-8180e2696df6b0702ae516060667e692c1cd2015.zip |
Regenerated StateMachine Diagram with latest code generator
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend-gen')
2 files changed, 282 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java new file mode 100644 index 00000000000..0965d5e7d4f --- /dev/null +++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others + * + * 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 + * Michael Golubev (Montages) - #386838 - migrate to Xtend2 + */ +package aspects.xpt.diagram.editpolicies; + +import com.google.common.base.Objects; +import com.google.inject.Inject; +import com.google.inject.Singleton; +import org.eclipse.gmf.codegen.gmfgen.GenApplication; +import org.eclipse.gmf.codegen.gmfgen.GenCommonBase; +import org.eclipse.gmf.codegen.gmfgen.GenDiagram; +import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator; +import org.eclipse.gmf.codegen.gmfgen.OpenDiagramBehaviour; +import org.eclipse.xtend2.lib.StringConcatenation; +import org.eclipse.xtext.xbase.lib.Extension; +import xpt.Common; +import xpt.editor.DiagramEditorUtil; + +@Singleton +@SuppressWarnings("all") +public class OpenDiagram extends xpt.diagram.editpolicies.OpenDiagram { + @Inject + @Extension + private Common _common; + + @Inject + private DiagramEditorUtil xptDiagramEditorUtil; + + public CharSequence openCommandClass_intializeNewDiagram(final OpenDiagramBehaviour it) { + StringConcatenation _builder = new StringConcatenation(); + CharSequence _generatedMemberComment = this._common.generatedMemberComment(); + _builder.append(_generatedMemberComment, ""); + _builder.newLineIfNotEmpty(); + _builder.append("protected org.eclipse.gmf.runtime.notation.Diagram intializeNewDiagram() throws org.eclipse.core.commands.ExecutionException {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("org.eclipse.gmf.runtime.notation.Diagram d = org.eclipse.gmf.runtime.diagram.core.services.ViewService.createDiagram(getDiagramDomainElement(), getDiagramKind(), getPreferencesHint());"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("if (d == null) {"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\");"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("diagramFacet.setDiagramLink(d);"); + _builder.newLine(); + _builder.append("\t"); + CharSequence __assert = this._common._assert("diagramFacet.eResource() != null"); + _builder.append(__assert, "\t"); + _builder.newLineIfNotEmpty(); + _builder.append("\t"); + _builder.append("diagramFacet.eResource().getContents().add(d);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("org.eclipse.emf.ecore.EObject container = diagramFacet.eContainer();"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("while (container instanceof org.eclipse.gmf.runtime.notation.View) {"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("((org.eclipse.gmf.runtime.notation.View) container).persist();"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("container = container.eContainer();"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("try {"); + _builder.newLine(); + { + GenCommonBase _subject = it.getSubject(); + GenDiagram _diagram = _subject.getDiagram(); + GenEditorGenerator _editorGen = _diagram.getEditorGen(); + GenApplication _application = _editorGen.getApplication(); + boolean _equals = Objects.equal(null, _application); + if (_equals) { + _builder.append("\t"); + _builder.append("new org.eclipse.ui.actions.WorkspaceModifyOperation() {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("protected void execute(org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.CoreException, java.lang.reflect.InvocationTargetException, InterruptedException {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t\t"); + _builder.append("try {"); + _builder.newLine(); + } + } + _builder.append("\t"); + _builder.append("for (java.util.Iterator<?> it = diagramFacet.eResource().getResourceSet().getResources().iterator(); it.hasNext();) {"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("org.eclipse.emf.ecore.resource.Resource nextResource = (org.eclipse.emf.ecore.resource.Resource) it.next();"); + _builder.newLine(); + _builder.append("\t\t"); + _builder.append("if (nextResource.isLoaded() && !getEditingDomain().isReadOnly(nextResource)) {"); + _builder.newLine(); + _builder.append("\t\t\t"); + _builder.append("nextResource.save("); + GenCommonBase _subject_1 = it.getSubject(); + GenDiagram _diagram_1 = _subject_1.getDiagram(); + CharSequence _qualifiedClassName = this.xptDiagramEditorUtil.qualifiedClassName(_diagram_1); + _builder.append(_qualifiedClassName, "\t\t\t"); + _builder.append(".getSaveOptions());"); + _builder.newLineIfNotEmpty(); + _builder.append("\t\t"); + _builder.append("}"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + { + GenCommonBase _subject_2 = it.getSubject(); + GenDiagram _diagram_2 = _subject_2.getDiagram(); + GenEditorGenerator _editorGen_1 = _diagram_2.getEditorGen(); + GenApplication _application_1 = _editorGen_1.getApplication(); + boolean _equals_1 = Objects.equal(null, _application_1); + if (_equals_1) { + _builder.append("\t"); + _builder.append("} catch (java.io.IOException ex) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("throw new java.lang.reflect.InvocationTargetException(ex, \"Save operation failed\");"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}\t\t"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}.run(null);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("} catch (java.lang.reflect.InvocationTargetException e) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", e);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("} catch (InterruptedException e) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", e);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + } else { + _builder.append("\t"); + _builder.append("} catch (java.io.IOException ex) {"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("\t"); + _builder.append("throw new org.eclipse.core.commands.ExecutionException(\"Can\'t create diagram of \'\" + getDiagramKind() + \"\' kind\", ex);"); + _builder.newLine(); + _builder.append("\t"); + _builder.append("}"); + _builder.newLine(); + } + } + _builder.append("\t"); + _builder.append("return d;"); + _builder.newLine(); + _builder.append("}"); + _builder.newLine(); + return _builder; + } +} diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java new file mode 100644 index 00000000000..fe89454a3e6 --- /dev/null +++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) 2007, 2010, 2013 Borland Software Corporation and others + * + * 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: + * Alexander Shatalin (Borland) - initial API and implementation + * Michael Golubev (Montages) - #386838 - migrate to Xtend2 + */ +package aspects.xpt.editor; + +import com.google.inject.Inject; +import com.google.inject.Singleton; +import org.eclipse.gmf.codegen.gmfgen.GenDiagram; +import org.eclipse.xtend2.lib.StringConcatenation; +import org.eclipse.xtext.xbase.lib.Extension; +import xpt.Externalizer; +import xpt.ExternalizerUtils_qvto; + +@Singleton +@SuppressWarnings("all") +public class NewDiagramFileWizard extends xpt.editor.NewDiagramFileWizard { + @Inject + @Extension + private ExternalizerUtils_qvto _externalizerUtils_qvto; + + @Inject + private Externalizer xptExternalizer; + + public CharSequence i18nValues(final GenDiagram it) { + StringConcatenation _builder = new StringConcatenation(); + String _i18nKeyForNewDiagramFileWizardCreationPage = this.i18nKeyForNewDiagramFileWizardCreationPage(it); + String _nameKey = this._externalizerUtils_qvto.nameKey(_i18nKeyForNewDiagramFileWizardCreationPage); + CharSequence _messageEntry = this.xptExternalizer.messageEntry(_nameKey, "Initialize new diagram file"); + _builder.append(_messageEntry, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardCreationPage_1 = this.i18nKeyForNewDiagramFileWizardCreationPage(it); + String _titleKey = this._externalizerUtils_qvto.titleKey(_i18nKeyForNewDiagramFileWizardCreationPage_1); + CharSequence _messageEntry_1 = this.xptExternalizer.messageEntry(_titleKey, "Diagram file"); + _builder.append(_messageEntry_1, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardCreationPage_2 = this.i18nKeyForNewDiagramFileWizardCreationPage(it); + String _descriptionKey = this._externalizerUtils_qvto.descriptionKey(_i18nKeyForNewDiagramFileWizardCreationPage_2); + CharSequence _messageEntry_2 = this.xptExternalizer.messageEntry(_descriptionKey, + "Create new diagram based on {0} model content"); + _builder.append(_messageEntry_2, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPage = this.i18nKeyForNewDiagramFileWizardRootSelectionPage(it); + String _nameKey_1 = this._externalizerUtils_qvto.nameKey(_i18nKeyForNewDiagramFileWizardRootSelectionPage); + CharSequence _messageEntry_3 = this.xptExternalizer.messageEntry(_nameKey_1, + "Select diagram root element"); + _builder.append(_messageEntry_3, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPage_1 = this.i18nKeyForNewDiagramFileWizardRootSelectionPage(it); + String _titleKey_1 = this._externalizerUtils_qvto.titleKey(_i18nKeyForNewDiagramFileWizardRootSelectionPage_1); + CharSequence _messageEntry_4 = this.xptExternalizer.messageEntry(_titleKey_1, "Diagram root element"); + _builder.append(_messageEntry_4, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPage_2 = this.i18nKeyForNewDiagramFileWizardRootSelectionPage(it); + String _descriptionKey_1 = this._externalizerUtils_qvto.descriptionKey(_i18nKeyForNewDiagramFileWizardRootSelectionPage_2); + CharSequence _messageEntry_5 = this.xptExternalizer.messageEntry(_descriptionKey_1, + "Select semantic model element to be depicted on diagram"); + _builder.append(_messageEntry_5, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPageSelectionTitle = this.i18nKeyForNewDiagramFileWizardRootSelectionPageSelectionTitle(it); + CharSequence _messageEntry_6 = this.xptExternalizer.messageEntry(_i18nKeyForNewDiagramFileWizardRootSelectionPageSelectionTitle, + "Select diagram root element:"); + _builder.append(_messageEntry_6, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPageNoSelectionMessage = this.i18nKeyForNewDiagramFileWizardRootSelectionPageNoSelectionMessage(it); + CharSequence _messageEntry_7 = this.xptExternalizer.messageEntry(_i18nKeyForNewDiagramFileWizardRootSelectionPageNoSelectionMessage, + "Diagram root element is not selected"); + _builder.append(_messageEntry_7, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardRootSelectionPageInvalidSelectionMessage = this.i18nKeyForNewDiagramFileWizardRootSelectionPageInvalidSelectionMessage(it); + CharSequence _messageEntry_8 = this.xptExternalizer.messageEntry(_i18nKeyForNewDiagramFileWizardRootSelectionPageInvalidSelectionMessage, + "Invalid diagram root element is selected"); + _builder.append(_messageEntry_8, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardInitDiagramCommand = this.i18nKeyForNewDiagramFileWizardInitDiagramCommand(it); + CharSequence _messageEntry_9 = this.xptExternalizer.messageEntry(_i18nKeyForNewDiagramFileWizardInitDiagramCommand, "Initializing diagram contents"); + _builder.append(_messageEntry_9, ""); + _builder.newLineIfNotEmpty(); + String _i18nKeyForNewDiagramFileWizardIncorrectRootError = this.i18nKeyForNewDiagramFileWizardIncorrectRootError(it); + CharSequence _messageEntry_10 = this.xptExternalizer.messageEntry(_i18nKeyForNewDiagramFileWizardIncorrectRootError, + "Incorrect model object stored as a root resource object"); + _builder.append(_messageEntry_10, ""); + _builder.newLineIfNotEmpty(); + return _builder; + } +} |