Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend')
-rw-r--r--plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend94
1 files changed, 47 insertions, 47 deletions
diff --git a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
index ee25e102f69..6e4fe0a5516 100644
--- a/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
+++ b/plugins/developer/org.eclipse.papyrus.def/xtend/aspects/impl/diagram/update/CanonicalUpdate.xtend
@@ -10,72 +10,72 @@
* 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.inject.Inject
-import com.google.inject.Singleton
-import metamodel.MetaModel
-import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
-import org.eclipse.gmf.codegen.gmfgen.GenDiagram
-import xpt.Common
-import xpt.diagram.updater.DiagramUpdater
-import xpt.diagram.updater.NodeDescriptor
-import xpt.diagram.updater.Utils_qvto
-import xpt.diagram.updater.LinkDescriptor
-import xpt.editor.VisualIDRegistry
-
-@Singleton class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
- @Inject extension Common;
- @Inject extension Utils_qvto;
-
- @Inject NodeDescriptor nodeDescriptor;
- @Inject MetaModel xptMetaModel;
- @Inject DiagramUpdater xptDiagramUpdater;
- @Inject LinkDescriptor linkDescriptor;
- @Inject VisualIDRegistry xptVisualIDRegistry;
-
- override def getFeaturesToSynchronizeMethod(GenContainerBase it) '''
- «IF getSemanticChildrenChildFeatures(it).size == 1»
+ */
+package aspects.impl.diagram.update
+
+import com.google.inject.Inject
+import com.google.inject.Singleton
+import metamodel.MetaModel
+import org.eclipse.gmf.codegen.gmfgen.GenContainerBase
+import org.eclipse.gmf.codegen.gmfgen.GenDiagram
+import xpt.Common
+import xpt.diagram.updater.DiagramUpdater
+import xpt.diagram.updater.NodeDescriptor
+import xpt.diagram.updater.Utils_qvto
+import xpt.diagram.updater.LinkDescriptor
+import xpt.editor.VisualIDRegistry
+
+@Singleton class CanonicalUpdate extends impl.diagram.update.CanonicalUpdate {
+ @Inject extension Common;
+ @Inject extension Utils_qvto;
+
+ @Inject NodeDescriptor nodeDescriptor;
+ @Inject MetaModel xptMetaModel;
+ @Inject DiagramUpdater xptDiagramUpdater;
+ @Inject LinkDescriptor linkDescriptor;
+ @Inject VisualIDRegistry xptVisualIDRegistry;
+
+ override def getFeaturesToSynchronizeMethod(GenContainerBase it) '''
+ «IF getSemanticChildrenChildFeatures(it).size == 1»
«generatedMemberComment»
protected org.eclipse.emf.ecore.EStructuralFeature getFeatureToSynchronize() {
return «xptMetaModel.MetaFeature(getSemanticChildrenContainmentFeatures(it).head)»;
}
- «ELSEIF getSemanticChildrenChildFeatures(it).size > 1»
+ «ELSEIF getSemanticChildrenChildFeatures(it).size > 1»
«generatedMemberComment»
protected java.util.Set<org.eclipse.emf.ecore.EStructuralFeature> getFeaturesToSynchronize() {
if (myFeaturesToSynchronize == null) {
myFeaturesToSynchronize = new java.util.HashSet<org.eclipse.emf.ecore.EStructuralFeature>();
- «FOR f : getSemanticChildrenContainmentFeatures(it)»
+ «FOR f : getSemanticChildrenContainmentFeatures(it)»
«addContainmentFeature(f)»
- «ENDFOR»
+ «ENDFOR»
}
return myFeaturesToSynchronize;
}
- «ENDIF»
- '''
-
- override def getSemanticChildrenListMethod(GenContainerBase it) '''
+ «ENDIF»
+ '''
+
+ override def getSemanticChildrenListMethod(GenContainerBase it) '''
«generatedMemberComment»
protected java.util.List<org.eclipse.emf.ecore.EObject> getSemanticChildrenList() {
- «IF hasSemanticChildren(it)/*REVISIT: is there real need for this check - Generator seems to consult needsCanonicalEP, which in turns ensures there are semantic children?*/»
+ «IF hasSemanticChildren(it)/*REVISIT: is there real need for this check - Generator seems to consult needsCanonicalEP, which in turns ensures there are semantic children?*/»
org.eclipse.gmf.runtime.notation.View viewObject = (org.eclipse.gmf.runtime.notation.View) getHost().getModel();
java.util.LinkedList<org.eclipse.emf.ecore.EObject> result = new java.util.LinkedList<org.eclipse.emf.ecore.EObject>();
- java.util.List<«nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)»> childDescriptors = «xptDiagramUpdater.
+ java.util.List<«nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)»> childDescriptors = «xptDiagramUpdater.
getSemanticChildrenMethodCall(it)»(viewObject);
for («nodeDescriptor.qualifiedClassName(it.diagram.editorGen.diagramUpdater)» d : childDescriptors) {
result.add(d.getModelElement());
}
return result;
- «ELSE»
+ «ELSE»
return java.util.Collections.EMPTY_LIST;
- «ENDIF»
+ «ENDIF»
}
- '''
-
- override def refreshConnectionsBody(GenDiagram it) '''
+ '''
+
+ override def refreshConnectionsBody(GenDiagram it) '''
«Domain2Notation(it)» domain2NotationMap = new «Domain2Notation(it)»();
java.util.Collection<«linkDescriptor.qualifiedClassName(editorGen.diagramUpdater)»> linkDescriptors = collectAllLinks(getDiagram(), domain2NotationMap);
java.util.List<org.eclipse.gmf.runtime.notation.View> edges = new java.util.ArrayList<org.eclipse.gmf.runtime.notation.View>();
@@ -110,16 +110,16 @@ import xpt.editor.VisualIDRegistry
}
deleteViews(existingLinks.iterator());
return createConnections(linkDescriptors, domain2NotationMap);
- '''
-
+ '''
+
override def collectAllLinksMethod(GenDiagram it) '''
«generatedMemberComment»
- private java.util.Collection<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, «Domain2Notation(
+ private java.util.Collection<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> collectAllLinks(org.eclipse.gmf.runtime.notation.View view, «Domain2Notation(
it)» domain2NotationMap) {
if (!«VisualIDRegistry::modelID(it)».equals(«xptVisualIDRegistry.getModelIDMethodCall(it)»(view))) {
return java.util.Collections.emptyList();
}
- java.util.LinkedList<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> result = new java.util.LinkedList<«linkDescriptor.
+ java.util.LinkedList<«linkDescriptor.qualifiedClassName(it.editorGen.diagramUpdater)»> result = new java.util.LinkedList<«linkDescriptor.
qualifiedClassName(it.editorGen.diagramUpdater)»>();
String vid = «xptVisualIDRegistry.getVisualIDMethodCall(it)»(view);
if (vid != null) {
@@ -137,7 +137,7 @@ import xpt.editor.VisualIDRegistry
}
return result;
}
- '''
+ '''
override getEditPartMethod(GenDiagram it) '''
«generatedMemberComment»
@@ -160,4 +160,4 @@ import xpt.editor.VisualIDRegistry
return null;
}
'''
-}
+}

Back to the top