Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2014-07-25 02:58:00 +0000
committerChristian W. Damus2014-07-25 02:58:58 +0000
commitc1c9a9e24dbd08f55073fd7c35d025f96a30ec88 (patch)
treed3b3b84b0231337a9ef70e21377d02e04479b78f /plugins/developer/org.eclipse.papyrus.def/xtend-gen
parent143014ab408abddd23f7b0e99551bda3fcd85978 (diff)
downloadorg.eclipse.papyrus-c1c9a9e24dbd08f55073fd7c35d025f96a30ec88.tar.gz
org.eclipse.papyrus-c1c9a9e24dbd08f55073fd7c35d025f96a30ec88.tar.xz
org.eclipse.papyrus-c1c9a9e24dbd08f55073fd7c35d025f96a30ec88.zip
440263: [All Diagrams] Do not set default names for relationships
https://bugs.eclipse.org/bugs/show_bug.cgi?id=440263 Deprecate/replace redundant NamedElement name initialization utility classes and make NamedElementUtil the canonical API for this purpose. Suppress default names for several relationship and relationship-like metaclasses in NamedElementUtil. Includes tweaks to existing diagram JUnit tests to adapt to the changed auto-naming requirements. Clean up persistent Xtend-generated sources that trip up on line-ending differences on Mac. Override the element initializer template from GMF to test whether the initial value is not null before attempting to set it, to avoid explicitly setting nulls in unsettable features such as UML::NamedElement::name. Update diagram generation models (except Sequence Diagram, which seems to be using some other templates) to use the element-sensitive initial name API and re-generate their ElementInitializers classes. Add some basic unit tests for the NamedElementUtil API. Change-Id: Icf2ee05a632c1f5988383c0348b8609c3dccf6be
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend-gen')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java44
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java188
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DocumentProvider.java259
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java94
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetModificationListener.java153
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ValidateAction.java379
6 files changed, 0 insertions, 1117 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java
deleted file mode 100644
index 994402ea8b4..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/Common.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/**
- * Copyright (c) 2006-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:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt;
-
-import com.google.common.base.Objects;
-import com.google.inject.Singleton;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.xtend2.lib.StringConcatenation;
-
-@Singleton
-@SuppressWarnings("all")
-public class Common extends xpt.Common {
- public CharSequence copyright(final GenEditorGenerator it) {
- StringConcatenation _builder = new StringConcatenation();
- {
- String _copyrightText = it.getCopyrightText();
- boolean _notEquals = (!Objects.equal(_copyrightText, null));
- if (_notEquals) {
- _builder.append("/**");
- _builder.newLine();
- _builder.append(" ");
- _builder.append("* ");
- String _copyrightText_1 = it.getCopyrightText();
- String _replaceAll = _copyrightText_1.replaceAll("\n", "\n * ");
- _builder.append(_replaceAll, " ");
- _builder.newLineIfNotEmpty();
- _builder.append(" ");
- _builder.append("*/");
- _builder.newLine();
- }
- }
- return _builder;
- }
-}
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
deleted file mode 100644
index 7054e67cd8a..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/OpenDiagram.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/**
- * 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/DocumentProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DocumentProvider.java
deleted file mode 100644
index a170bb0db43..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/DocumentProvider.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/**
- * 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.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.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import plugin.Activator;
-import xpt.Common;
-import xpt.Externalizer;
-
-@Singleton
-@SuppressWarnings("all")
-public class DocumentProvider extends xpt.editor.DocumentProvider {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private Activator xptActivator;
-
- @Inject
- private Externalizer xptExternalizer;
-
- public CharSequence setDocumentContent(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("protected void setDocumentContent(org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument document, org.eclipse.ui.IEditorInput element) throws org.eclipse.core.runtime.CoreException {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument diagramDocument = (org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDiagramDocument) document;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.transaction.TransactionalEditingDomain domain = diagramDocument.getEditingDomain();");
- _builder.newLine();
- _builder.append("\t");
- {
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(null, _application);
- if (_equals) {
- _builder.append("if (element instanceof ");
- CharSequence _fileEditorInputClassFQName = this.fileEditorInputClassFQName(it);
- _builder.append(_fileEditorInputClassFQName, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("org.eclipse.core.resources.IStorage storage = ((");
- CharSequence _fileEditorInputClassFQName_1 = this.fileEditorInputClassFQName(it);
- _builder.append(_fileEditorInputClassFQName_1, "\t\t");
- _builder.append(") element).getStorage();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.Diagram diagram = org.eclipse.gmf.runtime.diagram.ui.resources.editor.internal.util.DiagramIOUtil.load(domain, storage, true, getProgressMonitor());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("\t");
- _builder.append("document.setContent(diagram);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else ");
- }
- }
- _builder.append("if(element instanceof ");
- CharSequence _uriEditorInputClassFQName = this.uriEditorInputClassFQName(it);
- _builder.append(_uriEditorInputClassFQName, "\t");
- _builder.append(") {");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.common.util.URI uri = ((");
- CharSequence _uriEditorInputClassFQName_1 = this.uriEditorInputClassFQName(it);
- _builder.append(_uriEditorInputClassFQName_1, "\t\t");
- _builder.append(") element).getURI();");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.ecore.resource.Resource resource = null;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("resource = domain.getResourceSet().getResource(uri.trimFragment(), false);");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (resource == null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("resource = domain.getResourceSet().createResource(uri.trimFragment());");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (!resource.isLoaded()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("try {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("@SuppressWarnings({ \"rawtypes\", \"unchecked\" })");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("java.util.Map<?,?> options = new java.util.HashMap(org.eclipse.gmf.runtime.emf.core.resources.GMFResourceFactory.getDefaultLoadOptions());");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("// @see 171060 ");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("// options.put(org.eclipse.emf.ecore.xmi.XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("resource.load(options);");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("} catch (java.io.IOException e) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("resource.unload();");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("throw e;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (uri.fragment() != null) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("org.eclipse.emf.ecore.EObject rootElement = resource.getEObject(uri.fragment());");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (rootElement instanceof org.eclipse.gmf.runtime.notation.Diagram) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("document.setContent((org.eclipse.gmf.runtime.notation.Diagram) rootElement);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("for (java.util.Iterator<org.eclipse.emf.ecore.EObject> it = resource.getContents().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("Object rootElement = it.next();");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("if (rootElement instanceof org.eclipse.gmf.runtime.notation.Diagram) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("document.setContent((org.eclipse.gmf.runtime.notation.Diagram) rootElement);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("throw new RuntimeException(");
- GenEditorGenerator _editorGen_1 = it.getEditorGen();
- String _i18nKeyForDocumentProviderNoDiagramInResourceError = this.i18nKeyForDocumentProviderNoDiagramInResourceError(it);
- CharSequence _accessorCall = this.xptExternalizer.accessorCall(_editorGen_1, _i18nKeyForDocumentProviderNoDiagramInResourceError);
- _builder.append(_accessorCall, "\t\t\t");
- _builder.append(");");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("} catch (Exception e) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.core.runtime.CoreException thrownExcp = null;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (e instanceof org.eclipse.core.runtime.CoreException) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("thrownExcp = (org.eclipse.core.runtime.CoreException) e;");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("String msg = e.getLocalizedMessage();");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("thrownExcp = new org.eclipse.core.runtime.CoreException(new org.eclipse.core.runtime.Status(org.eclipse.core.runtime.IStatus.ERROR, ");
- GenEditorGenerator _editorGen_2 = it.getEditorGen();
- GenPlugin _plugin = _editorGen_2.getPlugin();
- CharSequence _qualifiedClassName = this.xptActivator.qualifiedClassName(_plugin);
- _builder.append(_qualifiedClassName, "\t\t\t\t");
- _builder.append(".ID, 0, ");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t\t");
- _builder.append("msg != null ? msg : ");
- GenEditorGenerator _editorGen_3 = it.getEditorGen();
- String _i18nKeyForDocumentProviderDiagramLoadingError = this.i18nKeyForDocumentProviderDiagramLoadingError(it);
- CharSequence _accessorCall_1 = this.xptExternalizer.accessorCall(_editorGen_3, _i18nKeyForDocumentProviderDiagramLoadingError);
- _builder.append(_accessorCall_1, "\t\t\t\t");
- _builder.append(", e));");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("throw thrownExcp;");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("} else {");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _throwIncorrectInputException = this.throwIncorrectInputException(it);
- _builder.append(_throwIncorrectInputException, "\t");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("}\t");
- _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
deleted file mode 100644
index 6ca4ddf3f04..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/NewDiagramFileWizard.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * 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;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetModificationListener.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetModificationListener.java
deleted file mode 100644
index c966464b9ae..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ResourceSetModificationListener.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Copyright (c) 2007, 2009, 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.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.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-import org.eclipse.xtend2.lib.StringConcatenation;
-import org.eclipse.xtext.xbase.lib.Extension;
-import xpt.Common;
-
-@Singleton
-@SuppressWarnings("all")
-public class ResourceSetModificationListener extends xpt.editor.ResourceSetModificationListener {
- @Inject
- @Extension
- private Common _common;
-
- public CharSequence notifyChanged(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.append("\t");
- _builder.newLineIfNotEmpty();
- _builder.append("public void notifyChanged(org.eclipse.emf.common.notify.Notification notification) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (notification.getNotifier() instanceof org.eclipse.emf.ecore.resource.ResourceSet) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("super.notifyChanged(notification);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (!notification.isTouch() && myModifiedFilter.matches(notification)) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("if (notification.getNotifier() instanceof org.eclipse.emf.ecore.resource.Resource) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.emf.ecore.resource.Resource resource = (org.eclipse.emf.ecore.resource.Resource) notification.getNotifier();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("if (resource.isLoaded()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("boolean modified = false;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("for (java.util.Iterator<org.eclipse.emf.ecore.resource.Resource> it = myInfo.getLoadedResourcesIterator(); it.hasNext() && !modified;) {");
- _builder.newLine();
- _builder.append("\t\t\t\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\t\t\t");
- _builder.append("if (nextResource.isLoaded()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("modified = nextResource.isModified();");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("boolean dirtyStateChanged = false;");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("synchronized (myInfo) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("if (modified != myInfo.fCanBeSaved) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("myInfo.fCanBeSaved = modified;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("dirtyStateChanged = true;");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- {
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(null, _application);
- if (_equals) {
- _builder.append("\t\t\t\t\t");
- _builder.append("if (!resource.isModified()) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("\t");
- _builder.append("myInfo.setSynchronized(resource);");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- }
- }
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("if (dirtyStateChanged) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("fireElementDirtyStateChanged(myInfo.getEditorInput(), modified);");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("if (!modified) {");
- _builder.newLine();
- _builder.append("\t\t\t\t\t\t");
- _builder.append("myInfo.setModificationStamp(computeModificationStamp(myInfo));");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ValidateAction.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ValidateAction.java
deleted file mode 100644
index 238d5acfbb8..00000000000
--- a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ValidateAction.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/**
- * 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:
- * Dmitry Stadnik (Borland) - initial API and implementation
- * Michael Golubev (Montages) - #386838 - migrate to Xtend2
- */
-package aspects.xpt.editor;
-
-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.GenDiagram;
-import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
-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 ValidateAction extends xpt.editor.ValidateAction {
- @Inject
- @Extension
- private Common _common;
-
- @Inject
- private DiagramEditorUtil xptDiagramEditorUtil;
-
- public CharSequence runNonUIValidation(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("public static void runNonUIValidation(org.eclipse.gmf.runtime.notation.View view) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.swt.widgets.Shell shell = org.eclipse.swt.widgets.Display.getCurrent().getActiveShell();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (shell == null) {");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("shell = new org.eclipse.swt.widgets.Shell();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart diagramEditPart =");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.OffscreenEditPartFactory.getInstance().createDiagramEditPart(");
- _builder.newLine();
- _builder.append("\t\t\t\t\t");
- _builder.append("view.getDiagram(),shell);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("runValidation(diagramEditPart, view);");
- _builder.newLine();
- _builder.append("}\t\t");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence createMarkersForStatus(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static void createMarkers(");
- _builder.newLine();
- _builder.append("\t\t");
- {
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(_application, null);
- if (_equals) {
- _builder.append("org.eclipse.core.resources.IFile");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- } else {
- _builder.append("org.eclipse.gmf.runtime.notation.View");
- }
- }
- _builder.append(" target,");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.core.runtime.IStatus validationStatus,");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart diagramEditPart) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (validationStatus.isOK()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("final org.eclipse.core.runtime.IStatus rootStatus = validationStatus;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List allStatuses = new java.util.ArrayList();");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _qualifiedClassName = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(".LazyElement2ViewMap element2ViewMap = new ");
- CharSequence _qualifiedClassName_1 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_1, "\t");
- _builder.append(".LazyElement2ViewMap(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("diagramEditPart.getDiagramView(),");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("collectTargetElements(rootStatus, new java.util.HashSet<org.eclipse.emf.ecore.EObject>(), allStatuses));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator it = allStatuses.iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.validation.model.IConstraintStatus nextStatus =");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("(org.eclipse.emf.validation.model.IConstraintStatus) it.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = ");
- CharSequence _qualifiedClassName_2 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_2, "\t");
- _builder.append(".findView(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("diagramEditPart, nextStatus.getTarget(), element2ViewMap);\t\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view), ");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil.getQualifiedName(nextStatus.getTarget(), true), ");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("nextStatus.getMessage(), nextStatus.getSeverity());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence createMarkersForDiagnostic(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static void createMarkers(");
- _builder.newLine();
- _builder.append("\t\t");
- {
- GenEditorGenerator _editorGen = it.getEditorGen();
- GenApplication _application = _editorGen.getApplication();
- boolean _equals = Objects.equal(_application, null);
- if (_equals) {
- _builder.append("org.eclipse.core.resources.IFile");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- } else {
- _builder.append("org.eclipse.gmf.runtime.notation.View");
- }
- }
- _builder.append(" target,");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("org.eclipse.emf.common.util.Diagnostic emfValidationStatus,");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart diagramEditPart) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (emfValidationStatus.getSeverity() == org.eclipse.emf.common.util.Diagnostic.OK) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("final org.eclipse.emf.common.util.Diagnostic rootStatus = emfValidationStatus;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<org.eclipse.emf.common.util.Diagnostic> allDiagnostics = new java.util.ArrayList<org.eclipse.emf.common.util.Diagnostic>();");
- _builder.newLine();
- _builder.append("\t");
- CharSequence _qualifiedClassName = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName, "\t");
- _builder.append(".LazyElement2ViewMap element2ViewMap =");
- _builder.newLineIfNotEmpty();
- _builder.append("\t");
- _builder.append("new ");
- CharSequence _qualifiedClassName_1 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_1, "\t");
- _builder.append(".LazyElement2ViewMap(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("diagramEditPart.getDiagramView(),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("collectTargetElements(rootStatus, new java.util.HashSet<org.eclipse.emf.ecore.EObject>(), allDiagnostics));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<org.eclipse.emf.common.util.Diagnostic> it = emfValidationStatus.getChildren().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.common.util.Diagnostic nextDiagnostic = (org.eclipse.emf.common.util.Diagnostic) it.next();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<?> data = nextDiagnostic.getData();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (data != null && !data.isEmpty() && data.get(0) instanceof org.eclipse.emf.ecore.EObject) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject element = (org.eclipse.emf.ecore.EObject) data.get(0);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.gmf.runtime.notation.View view = ");
- CharSequence _qualifiedClassName_2 = this.xptDiagramEditorUtil.qualifiedClassName(it);
- _builder.append(_qualifiedClassName_2, "\t");
- _builder.append(".findView(");
- _builder.newLineIfNotEmpty();
- _builder.append("\t\t");
- _builder.append("diagramEditPart, element, element2ViewMap);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("addMarker(diagramEditPart.getViewer(), target, view.eResource().getURIFragment(view),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil.getQualifiedName(element, true),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("nextDiagnostic.getMessage(), diagnosticToStatusSeverity(nextDiagnostic.getSeverity()));");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence collectTargetElementsFromStatus(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static java.util.Set<org.eclipse.emf.ecore.EObject> collectTargetElements(org.eclipse.core.runtime.IStatus status,");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("java.util.Set<org.eclipse.emf.ecore.EObject> targetElementCollector, java.util.List<org.eclipse.emf.validation.model.IConstraintStatus> allConstraintStatuses) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (status instanceof org.eclipse.emf.validation.model.IConstraintStatus) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("targetElementCollector.add(((org.eclipse.emf.validation.model.IConstraintStatus) status).getTarget());");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("allConstraintStatuses.add((org.eclipse.emf.validation.model.IConstraintStatus)status);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (status.isMultiStatus()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.core.runtime.IStatus[] children = status.getChildren();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (int i = 0; i < children.length; i++) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("collectTargetElements(children[i], targetElementCollector, allConstraintStatuses);\t\t\t\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return targetElementCollector;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-
- public CharSequence collectTargetElementsFromDiagnostic(final GenDiagram it) {
- StringConcatenation _builder = new StringConcatenation();
- _builder.newLine();
- CharSequence _generatedMemberComment = this._common.generatedMemberComment();
- _builder.append(_generatedMemberComment, "");
- _builder.newLineIfNotEmpty();
- _builder.append("private static java.util.Set<org.eclipse.emf.ecore.EObject> collectTargetElements(org.eclipse.emf.common.util.Diagnostic diagnostic,");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("java.util.Set<org.eclipse.emf.ecore.EObject> targetElementCollector, java.util.List<org.eclipse.emf.common.util.Diagnostic> allDiagnostics) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("java.util.List<?> data = diagnostic.getData();");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("org.eclipse.emf.ecore.EObject target = null;");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (data != null && !data.isEmpty() && data.get(0) instanceof org.eclipse.emf.ecore.EObject) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("target = (org.eclipse.emf.ecore.EObject) data.get(0);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("targetElementCollector.add(target);\t");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("allDiagnostics.add(diagnostic);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("if (diagnostic.getChildren() != null && !diagnostic.getChildren().isEmpty()) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("for (java.util.Iterator<org.eclipse.emf.common.util.Diagnostic> it = diagnostic.getChildren().iterator(); it.hasNext();) {");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("collectTargetElements((org.eclipse.emf.common.util.Diagnostic) it.next(),");
- _builder.newLine();
- _builder.append("\t\t");
- _builder.append("targetElementCollector, allDiagnostics);");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t");
- _builder.append("return targetElementCollector;");
- _builder.newLine();
- _builder.append("}");
- _builder.newLine();
- return _builder;
- }
-}

Back to the top