Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Noyrit2014-03-03 18:35:01 +0000
committerFlorian Noyrit2014-03-03 18:35:01 +0000
commit3724d11f5e8c95b39c35a1895ca977515d2fe392 (patch)
tree6df809ceee75ad07c1ff5e87fea7c2f0a6ebe3aa /plugins/developer/org.eclipse.papyrus.def/xtend-gen
parente6640915c57d431d04bd85d42bf6da5fa4434dda (diff)
downloadorg.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.tar.gz
org.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.tar.xz
org.eclipse.papyrus-3724d11f5e8c95b39c35a1895ca977515d2fe392.zip
Updated generation templates
Regenerated class diagram with many refactorings
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend-gen')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java413
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java154
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java46
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java44
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/UpdateCommand.java90
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java108
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/AbstractNavigatorItem.java118
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorContentProvider.java82
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorItem.java122
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorGroup.java67
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorItem.java98
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementTypes.java148
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/MarkerNavigationProvider.java254
13 files changed, 1744 insertions, 0 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java
new file mode 100644
index 00000000000..06c7f0f99b0
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/diagram/update/CanonicalUpdate.java
@@ -0,0 +1,413 @@
+/**
+ * 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
+ * Artem Tikhomirov - refactoring of containerBaseCanonicalMethods.xpt; extraction of API/non-API of CEP templates
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.impl.diagram.update;
+
+import com.google.common.base.Objects;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import java.util.Set;
+import metamodel.MetaModel;
+import org.eclipse.emf.codegen.ecore.genmodel.GenFeature;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
+import org.eclipse.gmf.codegen.gmfgen.GenLink;
+import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import org.eclipse.xtext.xbase.lib.Functions.Function1;
+import org.eclipse.xtext.xbase.lib.IterableExtensions;
+import xpt.Common;
+import xpt.diagram.updater.DiagramUpdater;
+import xpt.diagram.updater.LinkDescriptor;
+import xpt.diagram.updater.NodeDescriptor;
+import xpt.diagram.updater.Utils_qvto;
+import xpt.editor.VisualIDRegistry;
+
+@Singleton
+@SuppressWarnings("all")
+public class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
+ @Inject
+ @Extension
+ private Common _common;
+
+ @Inject
+ @Extension
+ private Utils_qvto _utils_qvto;
+
+ @Inject
+ private NodeDescriptor nodeDescriptor;
+
+ @Inject
+ private MetaModel xptMetaModel;
+
+ @Inject
+ private DiagramUpdater xptDiagramUpdater;
+
+ @Inject
+ private LinkDescriptor linkDescriptor;
+
+ @Inject
+ private VisualIDRegistry xptVisualIDRegistry;
+
+ public CharSequence getFeaturesToSynchronizeMethod(final GenContainerBase it) {
+ StringConcatenation _builder = new StringConcatenation();
+ {
+ Set<GenFeature> _semanticChildrenChildFeatures = this._utils_qvto.getSemanticChildrenChildFeatures(it);
+ int _size = _semanticChildrenChildFeatures.size();
+ boolean _equals = (_size == 1);
+ if (_equals) {
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("protected org.eclipse.emf.ecore.EStructuralFeature getFeatureToSynchronize() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("return ");
+ Set<GenFeature> _semanticChildrenContainmentFeatures = this._utils_qvto.getSemanticChildrenContainmentFeatures(it);
+ GenFeature _head = IterableExtensions.<GenFeature>head(_semanticChildrenContainmentFeatures);
+ CharSequence _MetaFeature = this.xptMetaModel.MetaFeature(_head);
+ _builder.append(_MetaFeature, "\t\t");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ } else {
+ Set<GenFeature> _semanticChildrenChildFeatures_1 = this._utils_qvto.getSemanticChildrenChildFeatures(it);
+ int _size_1 = _semanticChildrenChildFeatures_1.size();
+ boolean _greaterThan = (_size_1 > 1);
+ if (_greaterThan) {
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_1, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("protected java.util.Set<org.eclipse.emf.ecore.EStructuralFeature> getFeaturesToSynchronize() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (myFeaturesToSynchronize == null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("myFeaturesToSynchronize = new java.util.HashSet<org.eclipse.emf.ecore.EStructuralFeature>();");
+ _builder.newLine();
+ {
+ Set<GenFeature> _semanticChildrenContainmentFeatures_1 = this._utils_qvto.getSemanticChildrenContainmentFeatures(it);
+ for(final GenFeature f : _semanticChildrenContainmentFeatures_1) {
+ _builder.append("\t\t\t");
+ CharSequence _addContainmentFeature = this.addContainmentFeature(f);
+ _builder.append(_addContainmentFeature, "\t\t\t");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("return myFeaturesToSynchronize;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ }
+ }
+ }
+ return _builder;
+ }
+
+ public CharSequence getSemanticChildrenListMethod(final GenContainerBase it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("protected java.util.List<org.eclipse.emf.ecore.EObject> getSemanticChildrenList() {");
+ _builder.newLine();
+ {
+ boolean _hasSemanticChildren = this._utils_qvto.hasSemanticChildren(it);
+ if (_hasSemanticChildren) {
+ _builder.append("\t");
+ _builder.append("org.eclipse.gmf.runtime.notation.View viewObject = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("java.util.LinkedList<org.eclipse.emf.ecore.EObject> result = new java.util.LinkedList<org.eclipse.emf.ecore.EObject>();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("java.util.List<");
+ GenDiagram _diagram = it.getDiagram();
+ GenEditorGenerator _editorGen = _diagram.getEditorGen();
+ GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
+ CharSequence _qualifiedClassName = this.nodeDescriptor.qualifiedClassName(_diagramUpdater);
+ _builder.append(_qualifiedClassName, "\t");
+ _builder.append("> childDescriptors = ");
+ CharSequence _semanticChildrenMethodCall = this.xptDiagramUpdater.getSemanticChildrenMethodCall(it);
+ _builder.append(_semanticChildrenMethodCall, "\t");
+ _builder.append("(viewObject);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("for (");
+ GenDiagram _diagram_1 = it.getDiagram();
+ GenEditorGenerator _editorGen_1 = _diagram_1.getEditorGen();
+ GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
+ CharSequence _qualifiedClassName_1 = this.nodeDescriptor.qualifiedClassName(_diagramUpdater_1);
+ _builder.append(_qualifiedClassName_1, "\t");
+ _builder.append(" d : childDescriptors) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("\t");
+ _builder.append("result.add(d.getModelElement());");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return result;");
+ _builder.newLine();
+ } else {
+ _builder.append("\t");
+ _builder.append("return java.util.Collections.EMPTY_LIST;");
+ _builder.newLine();
+ }
+ }
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+
+ public CharSequence refreshConnectionsBody(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _Domain2Notation = this.Domain2Notation(it);
+ _builder.append(_Domain2Notation, "");
+ _builder.append(" domain2NotationMap = new ");
+ CharSequence _Domain2Notation_1 = this.Domain2Notation(it);
+ _builder.append(_Domain2Notation_1, "");
+ _builder.append("();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("java.util.Collection<");
+ GenEditorGenerator _editorGen = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
+ CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
+ _builder.append(_qualifiedClassName, "");
+ _builder.append("> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("java.util.List<org.eclipse.gmf.runtime.notation.View> edges = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>();");
+ _builder.newLine();
+ _builder.append("for (Object edge : getDiagram().getEdges())");
+ _builder.newLine();
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (edge instanceof org.eclipse.gmf.runtime.notation.View)");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("{");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("edges.add((org.eclipse.gmf.runtime.notation.View) edge);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("java.util.Collection<org.eclipse.gmf.runtime.notation.View> existingLinks = new java.util.LinkedList<org.eclipse.gmf.runtime.notation.View>(edges);");
+ _builder.newLine();
+ _builder.append("for (java.util.Iterator<org.eclipse.gmf.runtime.notation.View> linksIterator = existingLinks.iterator(); linksIterator.hasNext();) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.gmf.runtime.notation.Edge nextDiagramLink = (org.eclipse.gmf.runtime.notation.Edge) linksIterator.next();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("int diagramLinkVisualID = ");
+ CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(it);
+ _builder.append(_visualIDMethodCall, "\t");
+ _builder.append("(nextDiagramLink);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("if (diagramLinkVisualID == -1");
+ {
+ EList<GenLink> _links = it.getLinks();
+ final Function1<GenLink,Boolean> _function = new Function1<GenLink,Boolean>() {
+ public Boolean apply(final GenLink gl) {
+ LinkModelFacet _modelFacet = gl.getModelFacet();
+ return Boolean.valueOf(Objects.equal(_modelFacet, null));
+ }
+ };
+ Iterable<GenLink> _filter = IterableExtensions.<GenLink>filter(_links, _function);
+ for(final GenLink link : _filter) {
+ CharSequence _compareLinkVisualID = this.compareLinkVisualID(link);
+ _builder.append(_compareLinkVisualID, "\t");
+ }
+ }
+ _builder.append(") {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("if (nextDiagramLink.getSource() != null && nextDiagramLink.getTarget() != null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("linksIterator.remove();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("continue;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.emf.ecore.EObject diagramLinkObject = nextDiagramLink.getElement();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.emf.ecore.EObject diagramLinkSrc = nextDiagramLink.getSource().getElement();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.emf.ecore.EObject diagramLinkDst = nextDiagramLink.getTarget().getElement();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("for (java.util.Iterator<");
+ GenEditorGenerator _editorGen_1 = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
+ String _linkDescriptorQualifiedClassName = _diagramUpdater_1.getLinkDescriptorQualifiedClassName();
+ _builder.append(_linkDescriptorQualifiedClassName, "\t");
+ _builder.append("> linkDescriptorsIterator = linkDescriptors.iterator(); linkDescriptorsIterator.hasNext();) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ GenEditorGenerator _editorGen_2 = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater_2 = _editorGen_2.getDiagramUpdater();
+ CharSequence _qualifiedClassName_1 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_2);
+ _builder.append(_qualifiedClassName_1, "\t\t");
+ _builder.append(" nextLinkDescriptor = linkDescriptorsIterator.next();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("if (diagramLinkObject == nextLinkDescriptor.getModelElement() && diagramLinkSrc == nextLinkDescriptor.getSource() && diagramLinkDst == nextLinkDescriptor.getDestination() && diagramLinkVisualID == nextLinkDescriptor.getVisualID()) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("linksIterator.remove();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("linkDescriptorsIterator.remove();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("break;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("deleteViews(existingLinks.iterator());");
+ _builder.newLine();
+ _builder.append("return createConnections(linkDescriptors, domain2NotationMap);");
+ _builder.newLine();
+ return _builder;
+ }
+
+ public CharSequence collectAllLinksMethod(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("private java.util.Collection<");
+ GenEditorGenerator _editorGen = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater = _editorGen.getDiagramUpdater();
+ CharSequence _qualifiedClassName = this.linkDescriptor.qualifiedClassName(_diagramUpdater);
+ _builder.append(_qualifiedClassName, "");
+ _builder.append("> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, ");
+ CharSequence _Domain2Notation = this.Domain2Notation(it);
+ _builder.append(_Domain2Notation, "");
+ _builder.append(" domain2NotationMap) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("if (!");
+ CharSequence _modelID = VisualIDRegistry.modelID(it);
+ _builder.append(_modelID, "\t");
+ _builder.append(".equals(");
+ CharSequence _modelIDMethodCall = this.xptVisualIDRegistry.getModelIDMethodCall(it);
+ _builder.append(_modelIDMethodCall, "\t");
+ _builder.append("(view))) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("return java.util.Collections.emptyList();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("java.util.LinkedList<");
+ GenEditorGenerator _editorGen_1 = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater_1 = _editorGen_1.getDiagramUpdater();
+ CharSequence _qualifiedClassName_1 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_1);
+ _builder.append(_qualifiedClassName_1, "\t");
+ _builder.append("> result = new java.util.LinkedList<");
+ GenEditorGenerator _editorGen_2 = it.getEditorGen();
+ GenDiagramUpdater _diagramUpdater_2 = _editorGen_2.getDiagramUpdater();
+ CharSequence _qualifiedClassName_2 = this.linkDescriptor.qualifiedClassName(_diagramUpdater_2);
+ _builder.append(_qualifiedClassName_2, "\t");
+ _builder.append(">();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("switch (");
+ CharSequence _visualIDMethodCall = this.xptVisualIDRegistry.getVisualIDMethodCall(it);
+ _builder.append(_visualIDMethodCall, "\t");
+ _builder.append("(view)) {");
+ _builder.newLineIfNotEmpty();
+ {
+ Iterable<GenCommonBase> _allSemanticElements = this._utils_qvto.getAllSemanticElements(it);
+ for(final GenCommonBase se : _allSemanticElements) {
+ _builder.append("\t\t");
+ CharSequence _caseSemanticElement = this.caseSemanticElement(se);
+ _builder.append(_caseSemanticElement, "\t\t");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("for (java.util.Iterator<?> children = view.getChildren().iterator(); children.hasNext();) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("result.addAll(collectAllLinks((org.eclipse.gmf.runtime.notation.View) children.next(), domain2NotationMap));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("for (java.util.Iterator<?> edges = view.getSourceEdges().iterator(); edges.hasNext();) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("result.addAll(collectAllLinks((org.eclipse.gmf.runtime.notation.View) edges.next(), domain2NotationMap));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return result;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java
new file mode 100644
index 00000000000..db10e268b1b
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/impl/parsers/ParserProvider.java
@@ -0,0 +1,154 @@
+/**
+ * Copyright (c) 2007-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
+ * Artem Tikhomirov (Borland) - [235113] alternative parser access
+ * [244419] custom parsers
+ * [138179] expression-backed labels
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.impl.parsers;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import impl.parsers.expression_qvto;
+import metamodel.MetaModel;
+import org.eclipse.gmf.codegen.gmfgen.GenParsers;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import parsers.ExpressionLabelParser;
+import parsers.PredefinedParser;
+import plugin.Activator;
+import xpt.Common;
+import xpt.Common_qvto;
+import xpt.editor.VisualIDRegistry;
+import xpt.expressions.OclTracker_qvto;
+import xpt.expressions.getExpression;
+import xpt.providers.ElementTypes;
+import xpt.providers.ParserUtils_qvto;
+
+@Singleton
+@SuppressWarnings("all")
+public class ParserProvider extends impl.parsers.ParserProvider {
+ @Inject
+ @Extension
+ private Common _common;
+
+ @Inject
+ @Extension
+ private Common_qvto _common_qvto;
+
+ @Inject
+ @Extension
+ private OclTracker_qvto _oclTracker_qvto;
+
+ @Inject
+ @Extension
+ private ParserUtils_qvto _parserUtils_qvto;
+
+ @Inject
+ @Extension
+ private expression_qvto _expression_qvto;
+
+ @Inject
+ @Extension
+ private ExpressionLabelParser _expressionLabelParser;
+
+ @Inject
+ @Extension
+ private PredefinedParser _predefinedParser;
+
+ @Inject
+ private getExpression xptGetExpression;
+
+ @Inject
+ private MetaModel xptMetaModel;
+
+ @Inject
+ private VisualIDRegistry xptVisualIDRegistry;
+
+ @Inject
+ private ElementTypes xptElementTypes;
+
+ @Inject
+ private parsers.ParserProvider xptParsers;
+
+ @Inject
+ private Activator xptActivator;
+
+ public CharSequence HintAdapterClass(final GenParsers it) {
+ StringConcatenation _builder = new StringConcatenation();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("private static class HintAdapter extends org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter {");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_1, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("private final org.eclipse.gmf.runtime.emf.type.core.IElementType elementType;");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_2, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("public HintAdapter(org.eclipse.gmf.runtime.emf.type.core.IElementType type,");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("org.eclipse.emf.ecore.EObject object, String parserHint) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("super(object, parserHint);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ CharSequence __assert = this._common._assert("type != null");
+ _builder.append(__assert, "\t\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t");
+ _builder.append("elementType = type;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_3, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("public Object getAdapter(@SuppressWarnings(\"rawtypes\") Class adapter) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("if (org.eclipse.gmf.runtime.emf.type.core.IElementType.class.equals(adapter)) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("return elementType;");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return super.getAdapter(adapter);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java
new file mode 100644
index 00000000000..e742137b9bc
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/TextNonResizableEditPolicy.java
@@ -0,0 +1,46 @@
+package aspects.xpt.diagram.editpolicies;
+
+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.Common;
+
+/**
+ * FIXME: [MG] - reverse the calls? call common code from here and TextelectionEP and not vice versa
+ */
+@Singleton
+@SuppressWarnings("all")
+public class TextNonResizableEditPolicy extends xpt.diagram.editpolicies.TextNonResizableEditPolicy {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence TextNonResizableEditPolicy_createSelectionHandles(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("protected java.util.List<?> createSelectionHandles() {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.gef.handles.MoveHandle moveHandle =");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("new org.eclipse.gef.handles.MoveHandle((org.eclipse.gef.GraphicalEditPart) getHost());");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("moveHandle.setBorder(null);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("moveHandle.setDragTracker(new org.eclipse.gmf.runtime.diagram.ui.tools.DragEditPartsTrackerEx(getHost()));");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return java.util.Collections.singletonList(moveHandle);");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java
new file mode 100644
index 00000000000..91b44e77ab8
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/editpolicies/Utils_qvto.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (c) 2007-2013 Borland Software Corporation && others
+ *
+ * All rights reserved. This program && the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, && is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Alexander Shatalin (Borland) - initial API && implementation
+ * Michael Golubev (Borland) - [243151] explicit source/target for links
+ * - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.diagram.editpolicies;
+
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenLink;
+import org.eclipse.gmf.codegen.gmfgen.GenLinkEnd;
+
+@Singleton
+@SuppressWarnings("all")
+public class Utils_qvto extends xpt.diagram.editpolicies.Utils_qvto {
+ public Boolean containsCreateStartLinkCommand(final GenLinkEnd it) {
+ Iterable<GenLink> _allPotentialLinks = this.getAllPotentialLinks(it);
+ for (final GenLink l : _allPotentialLinks) {
+ boolean _createStartLinkCommand = this.createStartLinkCommand(l, it);
+ if (_createStartLinkCommand) {
+ return Boolean.valueOf(true);
+ }
+ }
+ return Boolean.valueOf(false);
+ }
+
+ public Boolean containsCreateCompleteLinkCommand(final GenLinkEnd it) {
+ Iterable<GenLink> _allPotentialLinks = this.getAllPotentialLinks(it);
+ for (final GenLink l : _allPotentialLinks) {
+ boolean _createCompleteLinkCommand = this.createCompleteLinkCommand(l, it);
+ if (_createCompleteLinkCommand) {
+ return Boolean.valueOf(true);
+ }
+ }
+ return Boolean.valueOf(false);
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/UpdateCommand.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/UpdateCommand.java
new file mode 100644
index 00000000000..a72c0854979
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/diagram/updater/UpdateCommand.java
@@ -0,0 +1,90 @@
+/**
+ * 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.diagram.updater;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagramUpdater;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class UpdateCommand extends xpt.diagram.updater.UpdateCommand {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence execute(final GenDiagramUpdater it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.jface.viewers.ISelection selection = org.eclipse.ui.PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (selection instanceof org.eclipse.jface.viewers.IStructuredSelection) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("org.eclipse.jface.viewers.IStructuredSelection structuredSelection = (org.eclipse.jface.viewers.IStructuredSelection) selection;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (structuredSelection.size() != 1) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return null;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (structuredSelection.getFirstElement() instanceof org.eclipse.gef.EditPart && ((org.eclipse.gef.EditPart) structuredSelection.getFirstElement()).getModel() instanceof org.eclipse.gmf.runtime.notation.View) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("org.eclipse.emf.ecore.EObject modelElement = ((org.eclipse.gmf.runtime.notation.View) ((org.eclipse.gef.EditPart) structuredSelection.getFirstElement()).getModel()).getElement();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("java.util.List<?> editPolicies = org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy.getRegisteredEditPolicies(modelElement);");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("for (java.util.Iterator<?> it = editPolicies.iterator(); it.hasNext();) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy nextEditPolicy = (org.eclipse.gmf.runtime.diagram.ui.editpolicies.CanonicalEditPolicy) it.next();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("nextEditPolicy.refresh();");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return null;");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java
new file mode 100644
index 00000000000..67ac810011e
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/editor/ActionBarContributor.java
@@ -0,0 +1,108 @@
+/**
+ * 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.editor;
+
+import aspects.xpt.editor.Editor;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
+import org.eclipse.gmf.codegen.gmfgen.GenEditorView;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class ActionBarContributor extends xpt.editor.ActionBarContributor {
+ @Inject
+ @Extension
+ private Common _common;
+
+ @Inject
+ private Editor xptEditor;
+
+ public CharSequence ActionBarContributor(final GenEditorView it) {
+ StringConcatenation _builder = new StringConcatenation();
+ GenEditorGenerator _editorGen = it.getEditorGen();
+ CharSequence _copyright = this._common.copyright(_editorGen);
+ _builder.append(_copyright, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("package ");
+ CharSequence _packageName = this.packageName(it);
+ _builder.append(_packageName, "");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ CharSequence _generatedClassComment = this._common.generatedClassComment();
+ _builder.append(_generatedClassComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public class ");
+ CharSequence _className = this.className(it);
+ _builder.append(_className, "");
+ _builder.append(" ");
+ CharSequence _extendsList = this.extendsList(it);
+ _builder.append(_extendsList, "");
+ _builder.append(" {");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("protected Class<");
+ CharSequence _qualifiedClassName = this.xptEditor.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName, "\t");
+ _builder.append("> getEditorClass() {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("return ");
+ CharSequence _qualifiedClassName_1 = this.xptEditor.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_1, "\t\t");
+ _builder.append(".class;");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_1, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("protected String getEditorId() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("return ");
+ CharSequence _qualifiedClassName_2 = this.xptEditor.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_2, "\t\t");
+ _builder.append(".ID;");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _initMethod = this.initMethod(it);
+ _builder.append(_initMethod, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ CharSequence _additions = this.additions(it);
+ _builder.append(_additions, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/AbstractNavigatorItem.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/AbstractNavigatorItem.java
new file mode 100644
index 00000000000..9f1ced08bb8
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/AbstractNavigatorItem.java
@@ -0,0 +1,118 @@
+/**
+ * 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.navigator;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenEditorGenerator;
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
+import org.eclipse.gmf.codegen.gmfgen.GenPlugin;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class AbstractNavigatorItem extends xpt.navigator.AbstractNavigatorItem {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence registerAdapterFactory(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("static {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("final Class[] supportedTypes = new Class[] { org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor.class };");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("final org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor propertySheetPageContributor = new org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public String getContributorId() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return \"");
+ GenEditorGenerator _editorGen = it.getEditorGen();
+ GenPlugin _plugin = _editorGen.getPlugin();
+ String _iD = _plugin.getID();
+ _builder.append(_iD, "\t\t\t");
+ _builder.append("\"; ");
+ CharSequence _nonNLS = this._common.nonNLS(1);
+ _builder.append(_nonNLS, "\t\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("};");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Object getAdapter(Object adaptableObject, Class adapterType) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("if (adaptableObject instanceof ");
+ CharSequence _qualifiedClassName = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName, "\t\t\t");
+ _builder.append(" && adapterType == org.eclipse.ui.views.properties.tabbed.ITabbedPropertySheetPageContributor.class) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
+ _builder.append("return propertySheetPageContributor;\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return null;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Class[] getAdapterList() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return supportedTypes;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}, ");
+ CharSequence _qualifiedClassName_1 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_1, "\t");
+ _builder.append(".class);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorContentProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorContentProvider.java
new file mode 100644
index 00000000000..5dcc390e87a
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorContentProvider.java
@@ -0,0 +1,82 @@
+/**
+ * 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.navigator;
+
+import aspects.xpt.navigator.DomainNavigatorItem;
+import aspects.xpt.navigator.NavigatorContentProvider;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import plugin.Activator;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class DomainNavigatorContentProvider extends xpt.navigator.DomainNavigatorContentProvider {
+ @Inject
+ @Extension
+ private Common _common;
+
+ @Inject
+ private Activator xptActivator;
+
+ @Inject
+ private NavigatorContentProvider xptNavigatorContentProvider;
+
+ @Inject
+ private DomainNavigatorItem xptDomainNavigatorItem;
+
+ public CharSequence wrapEObjects(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public Object[] wrapEObjects(Object[] objects, Object parentElement) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("java.util.Collection<");
+ CharSequence _qualifiedClassName = this.xptDomainNavigatorItem.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName, "\t");
+ _builder.append("> result = new java.util.ArrayList<");
+ CharSequence _qualifiedClassName_1 = this.xptDomainNavigatorItem.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_1, "\t");
+ _builder.append(">();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("for (int i = 0; i < objects.length; i++) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (objects[i] instanceof org.eclipse.emf.ecore.EObject) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("result.add(new ");
+ CharSequence _qualifiedClassName_2 = this.xptDomainNavigatorItem.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_2, "\t\t\t");
+ _builder.append("((org.eclipse.emf.ecore.EObject) objects[i], parentElement, myAdapterFctoryContentProvier));");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return result.toArray();");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorItem.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorItem.java
new file mode 100644
index 00000000000..a7661315129
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/DomainNavigatorItem.java
@@ -0,0 +1,122 @@
+/**
+ * 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.navigator;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class DomainNavigatorItem extends xpt.navigator.DomainNavigatorItem {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence registerAdapterFactory(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("static {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("final Class[] supportedTypes = new Class[] { org.eclipse.emf.ecore.EObject.class, org.eclipse.ui.views.properties.IPropertySource.class };");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Object getAdapter(Object adaptableObject, Class adapterType) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("if (adaptableObject instanceof ");
+ CharSequence _qualifiedClassName = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName, "\t\t\t");
+ _builder.append(") {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
+ CharSequence _qualifiedClassName_1 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_1, "\t\t\t\t");
+ _builder.append(" domainNavigatorItem = (");
+ CharSequence _qualifiedClassName_2 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_2, "\t\t\t\t");
+ _builder.append(") adaptableObject;");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
+ _builder.append("org.eclipse.emf.ecore.EObject eObject = domainNavigatorItem.getEObject();");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("if (adapterType == org.eclipse.emf.ecore.EObject.class) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("return eObject;");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("if (adapterType == org.eclipse.ui.views.properties.IPropertySource.class) {");
+ _builder.newLine();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("return domainNavigatorItem.getPropertySourceProvider().getPropertySource(eObject);");
+ _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.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return null;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Class[] getAdapterList() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return supportedTypes;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}, ");
+ CharSequence _qualifiedClassName_3 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_3, "\t");
+ _builder.append(".class);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorGroup.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorGroup.java
new file mode 100644
index 00000000000..0c36fb8db89
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorGroup.java
@@ -0,0 +1,67 @@
+/**
+ * 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.navigator;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class NavigatorGroup extends xpt.navigator.NavigatorGroup {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence attributes(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("private String myGroupName;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_1, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("private String myIcon;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.newLine();
+ CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_2, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("private java.util.Collection<java.lang.Object> myChildren = new java.util.LinkedList<java.lang.Object>();");
+ _builder.newLine();
+ return _builder;
+ }
+
+ public CharSequence addChildren(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public void addChildren(java.util.Collection<java.lang.Object> children) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("myChildren.addAll(children);");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorItem.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorItem.java
new file mode 100644
index 00000000000..a289da4bf33
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/navigator/NavigatorItem.java
@@ -0,0 +1,98 @@
+/**
+ * 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.navigator;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import org.eclipse.gmf.codegen.gmfgen.GenNavigator;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class NavigatorItem extends xpt.navigator.NavigatorItem {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence registerAdapterFactory(final GenNavigator it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("static {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("final Class[] supportedTypes = new Class[] { org.eclipse.gmf.runtime.notation.View.class, org.eclipse.emf.ecore.EObject.class };");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.core.runtime.Platform.getAdapterManager().registerAdapters(new org.eclipse.core.runtime.IAdapterFactory() {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Object getAdapter(Object adaptableObject, Class adapterType) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("if (adaptableObject instanceof ");
+ CharSequence _qualifiedClassName = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName, "\t\t\t");
+ _builder.append(" && (adapterType == org.eclipse.gmf.runtime.notation.View.class || adapterType == org.eclipse.emf.ecore.EObject.class)) {");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
+ _builder.append("return ((");
+ CharSequence _qualifiedClassName_1 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_1, "\t\t\t\t");
+ _builder.append(") adaptableObject).getView();");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return null;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("@SuppressWarnings(\"rawtypes\")");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("public Class[] getAdapterList() {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return supportedTypes;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}, ");
+ CharSequence _qualifiedClassName_2 = this.qualifiedClassName(it);
+ _builder.append(_qualifiedClassName_2, "\t");
+ _builder.append(".class);");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementTypes.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementTypes.java
new file mode 100644
index 00000000000..e3ec7e56209
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/ElementTypes.java
@@ -0,0 +1,148 @@
+/**
+ * Copyright (c) 2006, 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.providers;
+
+import com.google.common.base.Objects;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import java.util.List;
+import org.eclipse.emf.codegen.ecore.genmodel.GenClass;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.gmf.codegen.gmfgen.GenCommonBase;
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram;
+import org.eclipse.gmf.codegen.gmfgen.GenLink;
+import org.eclipse.gmf.codegen.gmfgen.GenNode;
+import org.eclipse.gmf.codegen.gmfgen.LinkModelFacet;
+import org.eclipse.gmf.codegen.gmfgen.TypeModelFacet;
+import org.eclipse.xtend2.lib.StringConcatenation;
+import org.eclipse.xtext.xbase.lib.Extension;
+import xpt.Common;
+import xpt.diagram.Utils_qvto;
+
+@Singleton
+@SuppressWarnings("all")
+public class ElementTypes extends xpt.providers.ElementTypes {
+ @Inject
+ @Extension
+ private Common _common;
+
+ @Inject
+ @Extension
+ private Utils_qvto _utils_qvto;
+
+ public CharSequence getElement(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment("Returns \'type\' of the ecore object associated with the hint.\n");
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public static synchronized org.eclipse.emf.ecore.ENamedElement getElement(org.eclipse.core.runtime.IAdaptable hint) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("Object type = hint.getAdapter(org.eclipse.gmf.runtime.emf.type.core.IElementType.class);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (elements == null) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("elements = new java.util.IdentityHashMap<org.eclipse.gmf.runtime.emf.type.core.IElementType, org.eclipse.emf.ecore.ENamedElement>();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ {
+ GenClass _domainDiagramElement = it.getDomainDiagramElement();
+ boolean _notEquals = (!Objects.equal(_domainDiagramElement, null));
+ if (_notEquals) {
+ GenClass _domainDiagramElement_1 = it.getDomainDiagramElement();
+ String _uniqueIdentifier = it.getUniqueIdentifier();
+ CharSequence _bindUniqueIdentifierToNamedElement = this.bindUniqueIdentifierToNamedElement(_domainDiagramElement_1, _uniqueIdentifier);
+ _builder.append(_bindUniqueIdentifierToNamedElement, "\t\t");
+ }
+ }
+ _builder.newLineIfNotEmpty();
+ {
+ EList<GenNode> _allNodes = it.getAllNodes();
+ for(final GenNode node : _allNodes) {
+ _builder.append("\t\t");
+ {
+ TypeModelFacet _modelFacet = node.getModelFacet();
+ boolean _notEquals_1 = (!Objects.equal(_modelFacet, null));
+ if (_notEquals_1) {
+ TypeModelFacet _modelFacet_1 = node.getModelFacet();
+ String _uniqueIdentifier_1 = node.getUniqueIdentifier();
+ CharSequence _bindUniqueIdentifierToNamedElement_1 = this.bindUniqueIdentifierToNamedElement(_modelFacet_1, _uniqueIdentifier_1);
+ _builder.append(_bindUniqueIdentifierToNamedElement_1, "\t\t");
+ }
+ }
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ {
+ EList<GenLink> _links = it.getLinks();
+ for(final GenLink link : _links) {
+ _builder.append("\t\t");
+ {
+ LinkModelFacet _modelFacet_2 = link.getModelFacet();
+ boolean _notEquals_2 = (!Objects.equal(_modelFacet_2, null));
+ if (_notEquals_2) {
+ LinkModelFacet _modelFacet_3 = link.getModelFacet();
+ String _uniqueIdentifier_2 = link.getUniqueIdentifier();
+ CharSequence _bindUniqueIdentifierToNamedElement_2 = this.bindUniqueIdentifierToNamedElement(_modelFacet_3, _uniqueIdentifier_2);
+ _builder.append(_bindUniqueIdentifierToNamedElement_2, "\t\t");
+ }
+ }
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return (org.eclipse.emf.ecore.ENamedElement) elements.get(type);");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+
+ public CharSequence isKnownElementType(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public static synchronized boolean isKnownElementType(org.eclipse.gmf.runtime.emf.type.core.IElementType elementType) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if (KNOWN_ELEMENT_TYPES == null) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("KNOWN_ELEMENT_TYPES = new java.util.HashSet<org.eclipse.gmf.runtime.emf.type.core.IElementType>();");
+ _builder.newLine();
+ {
+ List<GenCommonBase> _allTypedElements = this._utils_qvto.getAllTypedElements(it);
+ for(final GenCommonBase e : _allTypedElements) {
+ _builder.append("\t\t");
+ CharSequence _addKnownElementType = this.addKnownElementType(e);
+ _builder.append(_addKnownElementType, "\t\t");
+ _builder.newLineIfNotEmpty();
+ }
+ }
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return KNOWN_ELEMENT_TYPES.contains(elementType);");
+ _builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/MarkerNavigationProvider.java b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/MarkerNavigationProvider.java
new file mode 100644
index 00000000000..23187937399
--- /dev/null
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend-gen/aspects/xpt/providers/MarkerNavigationProvider.java
@@ -0,0 +1,254 @@
+/**
+ * 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:
+ * Dmitry Stadnik (Borland) - initial API and implementation
+ * Michael Golubev (Montages) - #386838 - migrate to Xtend2
+ */
+package aspects.xpt.providers;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+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 xpt.Common;
+
+@Singleton
+@SuppressWarnings("all")
+public class MarkerNavigationProvider extends xpt.providers.MarkerNavigationProvider {
+ @Inject
+ @Extension
+ private Common _common;
+
+ public CharSequence MarkerNavigationProvider(final GenDiagram it) {
+ StringConcatenation _builder = new StringConcatenation();
+ GenEditorGenerator _editorGen = it.getEditorGen();
+ CharSequence _copyright = this._common.copyright(_editorGen);
+ _builder.append(_copyright, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("package ");
+ CharSequence _packageName = this.packageName(it);
+ _builder.append(_packageName, "");
+ _builder.append(";");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ CharSequence _generatedClassComment = this._common.generatedClassComment();
+ _builder.append(_generatedClassComment, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("public class ");
+ CharSequence _className = this.className(it);
+ _builder.append(_className, "");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("extends org.eclipse.gmf.runtime.emf.ui.providers.marker.AbstractModelMarkerNavigationProvider {");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("public static final String MARKER_TYPE =");
+ _builder.newLine();
+ _builder.append("\t\t");
+ GenEditorGenerator _editorGen_1 = it.getEditorGen();
+ GenPlugin _plugin = _editorGen_1.getPlugin();
+ String _activatorQualifiedClassName = _plugin.getActivatorQualifiedClassName();
+ _builder.append(_activatorQualifiedClassName, "\t\t");
+ _builder.append(".ID + \".");
+ String _validationDiagnosticMarkerType = it.getValidationDiagnosticMarkerType();
+ _builder.append(_validationDiagnosticMarkerType, "\t\t");
+ _builder.append("\"; ");
+ CharSequence _nonNLS = this._common.nonNLS(1);
+ _builder.append(_nonNLS, "\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment_1 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_1, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("protected void doGotoMarker(org.eclipse.core.resources.IMarker marker) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("String elementId = marker.getAttribute(org.eclipse.gmf.runtime.common.core.resources.IMarker.ELEMENT_ID, null);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (elementId == null || !(getEditor() instanceof org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor)) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor editor =");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("(org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor) getEditor();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("java.util.Map<?, ?> editPartRegistry = editor.getDiagramGraphicalViewer().getEditPartRegistry();");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("org.eclipse.emf.ecore.EObject targetView = editor.getDiagram().eResource().getEObject(elementId);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (targetView == null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("return;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("org.eclipse.gef.EditPart targetEditPart = (org.eclipse.gef.EditPart) editPartRegistry.get(targetView);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (targetEditPart != null) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ String _diagramEditorUtilQualifiedClassName = it.getDiagramEditorUtilQualifiedClassName();
+ _builder.append(_diagramEditorUtilQualifiedClassName, "\t\t\t");
+ _builder.append(".selectElementsInDiagram(");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("editor, java.util.Arrays.asList(new org.eclipse.gef.EditPart[] { targetEditPart }));");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment_2 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_2, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("public static void deleteMarkers(org.eclipse.core.resources.IResource resource) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("try {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("resource.deleteMarkers(MARKER_TYPE, true, org.eclipse.core.resources.IResource.DEPTH_ZERO);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("} catch (org.eclipse.core.runtime.CoreException e) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ GenEditorGenerator _editorGen_2 = it.getEditorGen();
+ GenPlugin _plugin_1 = _editorGen_2.getPlugin();
+ String _activatorQualifiedClassName_1 = _plugin_1.getActivatorQualifiedClassName();
+ _builder.append(_activatorQualifiedClassName_1, "\t\t\t");
+ _builder.append(".getInstance().logError(");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t\t");
+ _builder.append("\"Failed to delete validation markers\", e); ");
+ CharSequence _nonNLS_1 = this._common.nonNLS(1);
+ _builder.append(_nonNLS_1, "\t\t\t\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _generatedMemberComment_3 = this._common.generatedMemberComment();
+ _builder.append(_generatedMemberComment_3, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("public static org.eclipse.core.resources.IMarker addMarker(org.eclipse.core.resources.IFile file,");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("String elementId, String location, String message, int statusSeverity) {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("org.eclipse.core.resources.IMarker marker = null;");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("try {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("marker = file.createMarker(MARKER_TYPE);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("marker.setAttribute(org.eclipse.core.resources.IMarker.MESSAGE, message);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("marker.setAttribute(org.eclipse.core.resources.IMarker.LOCATION, location);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("marker.setAttribute(org.eclipse.gmf.runtime.common.ui.resources.IMarker.ELEMENT_ID, elementId);");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("int markerSeverity = org.eclipse.core.resources.IMarker.SEVERITY_INFO;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("if (statusSeverity == org.eclipse.core.runtime.IStatus.WARNING) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("markerSeverity = org.eclipse.core.resources.IMarker.SEVERITY_WARNING; \t\t\t\t\t\t");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("} else if (statusSeverity == org.eclipse.core.runtime.IStatus.ERROR ||");
+ _builder.newLine();
+ _builder.append("\t\t\t\t");
+ _builder.append("statusSeverity == org.eclipse.core.runtime.IStatus.CANCEL) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("markerSeverity = org.eclipse.core.resources.IMarker.SEVERITY_ERROR;");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("marker.setAttribute(org.eclipse.core.resources.IMarker.SEVERITY, markerSeverity);");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("} catch (org.eclipse.core.runtime.CoreException e) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ GenEditorGenerator _editorGen_3 = it.getEditorGen();
+ GenPlugin _plugin_2 = _editorGen_3.getPlugin();
+ String _activatorQualifiedClassName_2 = _plugin_2.getActivatorQualifiedClassName();
+ _builder.append(_activatorQualifiedClassName_2, "\t\t");
+ _builder.append(".getInstance().logError(");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t\t\t\t");
+ _builder.append("\"Failed to create validation marker\", e); ");
+ CharSequence _nonNLS_2 = this._common.nonNLS(1);
+ _builder.append(_nonNLS_2, "\t\t\t\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("return marker;\t\t");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("}\t");
+ _builder.newLine();
+ _builder.append("\t");
+ CharSequence _additions = this.additions(it);
+ _builder.append(_additions, "\t");
+ _builder.newLineIfNotEmpty();
+ _builder.append("}");
+ _builder.newLine();
+ return _builder;
+ }
+}

Back to the top