summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenoit Maggi2014-04-08 08:35:57 (EDT)
committerBenoit Maggi2014-04-08 08:40:19 (EDT)
commit6ca0730998ef904252b73645a6d57288fd2d38e1 (patch)
tree9ec7352fae5ef022b44d1553727dcfa84fda08e6
parent97f6bf56bdf0df0f2cec472ace387cfa997e23e9 (diff)
downloadorg.eclipse.papyrus-6ca0730998ef904252b73645a6d57288fd2d38e1.zip
org.eclipse.papyrus-6ca0730998ef904252b73645a6d57288fd2d38e1.tar.gz
org.eclipse.papyrus-6ca0730998ef904252b73645a6d57288fd2d38e1.tar.bz2
Patch sysml.modelexplorer.tests for copy-pasterefs/changes/36/24636/1
Change-Id: I4dc10a381a32b3c385c1d2b6ec1c1a2329682cf0 Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath2
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF5
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml6
-rw-r--r--plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/strategy/paste/PartPasteStrategy.java347
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF1
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath15
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java)4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java)6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java)15
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java)6
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java)4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java)2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java)2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java)2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java)2
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java (renamed from tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java)4
17 files changed, 394 insertions, 36 deletions
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
index a93010f..beb405d 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen"/>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
index 980d467..8000cd6 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/.settings/org.eclipse.jdt.core.prefs
@@ -1,12 +1,11 @@
-#Thu Apr 21 15:05:56 CEST 2011
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
index 58301b5..a675c44 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/META-INF/MANIFEST.MF
@@ -69,7 +69,6 @@ Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-Activator: org.eclipse.papyrus.sysml.diagram.common.Activator
Bundle-ManifestVersion: 2
-Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.common;singleto
- n:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.common;singleton:=true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
index d04bf6a..f2a731c 100644
--- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/plugin.xml
@@ -43,6 +43,12 @@
</with>
</and>
</definition>
+</extension>
+<extension
+ point="org.eclipse.papyrus.infra.gmfdiag.common.pasteStrategy">
+ <strategy
+ strategy="org.eclipse.papyrus.sysml.diagram.common.strategy.paste.PartPasteStrategy">
+ </strategy>
</extension>
</plugin>
diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/strategy/paste/PartPasteStrategy.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/strategy/paste/PartPasteStrategy.java
new file mode 100644
index 0000000..d512c06
--- /dev/null
+++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src/org/eclipse/papyrus/sysml/diagram/common/strategy/paste/PartPasteStrategy.java
@@ -0,0 +1,347 @@
+/*****************************************************************************
+ * Copyright (c) 2014 CEA LIST.
+ *
+ * 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:
+ * Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.common.strategy.paste;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import org.eclipse.emf.common.command.CompoundCommand;
+import org.eclipse.emf.common.util.BasicEList;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.MoveRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.clipboard.IClipboardAdditionalData;
+import org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard;
+import org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.sysml.blocks.Block;
+import org.eclipse.papyrus.uml.diagram.common.Activator;
+import org.eclipse.papyrus.uml.diagram.common.strategy.paste.DefaultPasteStrategy;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Classifier;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.util.UMLUtil;
+
+/**
+ * Offer a strategy for copying stereotypes.
+ */
+public class PartPasteStrategy implements IPasteStrategy {
+
+ /** The instance. */
+ private static IPasteStrategy instance = new PartPasteStrategy();
+
+ /**
+ * Gets the single instance of StereotypePasteStrategy.
+ *
+ * @return single instance of StereotypePasteStrategy
+ */
+ public static IPasteStrategy getInstance() {
+ return instance;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getLabel()
+ */
+ public String getLabel() {
+ return "partPasteStrategy"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getID()
+ */
+ public String getID() {
+ return Activator.ID + ".partPasteStrategy"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getDescription()
+ */
+ public String getDescription() {
+ return "Paste part elements with association"; //$NON-NLS-1$
+ }
+
+ /**
+ * Gets the category id.
+ *
+ * @return the category id
+ */
+ public String getCategoryID() {
+ return "org.eclipse.papyrus.strategy.paste"; //$NON-NLS-1$
+ }
+
+ /**
+ * Gets the category label.
+ *
+ * @return the category label
+ */
+ public String getCategoryLabel() {
+ return "Paste all copied elements"; //$NON-NLS-1$
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getImage()
+ */
+ @Deprecated
+ public Image getImage() {
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getPriority()
+ */
+ @Deprecated
+ public int getPriority() {
+ return 1;
+ }
+
+ /**
+ * Sets the options.
+ *
+ * @param options
+ * the options
+ */
+ public void setOptions(Map<String, Object> options) {
+ //Nothing
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getSemanticCommand(org.eclipse.emf.edit.domain.EditingDomain,
+ * org.eclipse.emf.ecore.EObject, org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard)
+ */
+ @Override
+ public org.eclipse.emf.common.command.Command getSemanticCommand(EditingDomain domain, EObject targetOwner, PapyrusClipboard<Object> papyrusClipboard) {
+ if(targetOwner instanceof Classifier || targetOwner instanceof Package) { // test if block or package
+ // get affiliate AdditionnalData
+ Map<Object, ?> additionalDataMap = papyrusClipboard.getAdditionalDataForStrategy(getID());
+ if(additionalDataMap != null) {
+ CompoundCommand compoundCommand = new CompoundCommand("Copy associations for parts"); //$NON-NLS-1$
+ for(Iterator<Object> iterator = papyrusClipboard.iterator(); iterator.hasNext();) {
+ Object object = iterator.next();
+ EObject target = papyrusClipboard.getTragetCopyFromInternalClipboardCopy(object);
+ Object additionnalData = additionalDataMap.get(object);
+ EList<Association> listDuplicatedAssociation = new BasicEList<Association>();
+ EObject associationContainer = null;
+ if(target != null && target instanceof Property && targetOwner instanceof Classifier && additionnalData instanceof PartAdditionalData) { // test if it is a part
+ Classifier block = (Classifier)targetOwner;
+ Property property = (Property)target;
+ PartAdditionalData partAdditionalData = (PartAdditionalData)additionnalData;
+ Association newAssociation = partAdditionalData.getDuplicatedAssociation();
+ restoreAssociationPartContext(block, property, newAssociation);
+ listDuplicatedAssociation.add(newAssociation);
+ associationContainer = block.eContainer();
+ } else if(target != null && target instanceof Classifier && targetOwner instanceof Package && additionnalData instanceof PartBlockAdditionalData) { // test if it is a block
+ Classifier classifier = (Classifier)target;
+ EList<Property> allAttributes = classifier.getAllAttributes();
+ PartBlockAdditionalData partBlockAdditionalData = (PartBlockAdditionalData)additionnalData;
+ for(Property property : allAttributes) {
+ Association duplicatedAssociation = partBlockAdditionalData.getDuplicatedAssociationByPropertyName(property.getName());
+ restoreAssociationPartContext(classifier, property, duplicatedAssociation);
+ listDuplicatedAssociation.add(duplicatedAssociation);
+ }
+ associationContainer = targetOwner;
+ }
+ if(associationContainer != null && !listDuplicatedAssociation.isEmpty()) {
+ // add associations to the nearest container
+ MoveRequest moveRequest = new MoveRequest(associationContainer, listDuplicatedAssociation);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(targetOwner);
+ if(provider != null) {
+ ICommand editCommand = provider.getEditCommand(moveRequest);
+ GMFtoEMFCommandWrapper gmFtoEMFCommandWrapper = new GMFtoEMFCommandWrapper(editCommand);
+ compoundCommand.append(gmFtoEMFCommandWrapper);
+ }
+ }
+ }
+ // An empty command can't be executed
+ if(compoundCommand.getCommandList().isEmpty()) {
+ return null;
+ }
+ return compoundCommand;
+ }
+ }
+ return null;
+ }
+
+
+
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#getGraphicalCommand(org.eclipse.emf.edit.domain.EditingDomain,
+ * org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart, org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard)
+ */
+ @Override
+ public Command getGraphicalCommand(EditingDomain domain, org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart targetEditPart, PapyrusClipboard<Object> papyrusClipboard) {
+ View targetView = (View)targetEditPart.getModel();
+ EObject targetOwner = (EObject)targetView.getElement();
+ org.eclipse.emf.common.command.Command semanticCommand = getSemanticCommand(domain, targetOwner, papyrusClipboard);
+ if(semanticCommand != null) {
+ org.eclipse.gef.commands.CompoundCommand compoundCommand = new org.eclipse.gef.commands.CompoundCommand("Association Part Semantic And Graphical paste"); //$NON-NLS-1$
+ EMFtoGEFCommandWrapper emFtoGEFCommandWrapper = new EMFtoGEFCommandWrapper(semanticCommand);
+ compoundCommand.add(emFtoGEFCommandWrapper);
+ return compoundCommand;
+ }
+ return null;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#dependsOn()
+ */
+ @Override
+ public IPasteStrategy dependsOn() {
+ return DefaultPasteStrategy.getInstance();
+ }
+
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.papyrus.infra.gmfdiag.common.strategy.paste.IPasteStrategy#prepare(org.eclipse.papyrus.infra.core.clipboard.PapyrusClipboard)
+ */
+ @Override
+ public void prepare(PapyrusClipboard<Object> papyrusClipboard) {
+ Map<Object, IClipboardAdditionalData> mapCopyPartData = new HashMap<Object, IClipboardAdditionalData>();
+ for(Iterator<EObject> iterator = papyrusClipboard.iterateOnSource(); iterator.hasNext();) {
+ EObject eObjectSource = iterator.next();
+ if(eObjectSource instanceof Element) {
+ Element elementSource = (Element)eObjectSource;
+ IClipboardAdditionalData clipboardAdditionalData = null;
+ if(elementSource instanceof Property && UMLUtil.getStereotypeApplication(elementSource.getOwner(), Block.class) != null) { // is part
+ Property propertySource = (Property)elementSource;
+ clipboardAdditionalData = new PartAdditionalData(propertySource.getAssociation());
+ } else if(elementSource instanceof Classifier && UMLUtil.getStereotypeApplication(elementSource, Block.class) != null) {// is Block
+ Classifier block = (Classifier)elementSource;
+ clipboardAdditionalData = new PartBlockAdditionalData(block);
+ }
+ if(clipboardAdditionalData != null) {
+ Object copy = papyrusClipboard.getCopyFromSource(eObjectSource);
+ mapCopyPartData.put(copy, clipboardAdditionalData);
+ }
+ }
+
+ }
+ papyrusClipboard.pushAdditionalData(getID(), mapCopyPartData);
+ }
+
+
+ /**
+ * Duplicate the association
+ * @param association
+ * @return
+ */
+ protected Association duplicateAssociation(Association association) {
+ EcoreUtil.Copier copier = new EcoreUtil.Copier();
+ copier.copy(association);
+ EObject eObject = copier.get(association);
+ return (Association)eObject;
+ }
+
+ /**
+ * Init the association in the new context
+ * @param classifier
+ * @param property
+ * @param association
+ */
+ protected void restoreAssociationPartContext(Classifier classifier, Property property, Association association) {
+ EList<Property> memberEnds = association.getMemberEnds(); // should have only one element
+ if (memberEnds != null && !memberEnds.isEmpty()){
+ Property blockProperty = memberEnds.get(0);
+ blockProperty.setType(classifier);
+ }
+ memberEnds.add(property);
+ }
+
+
+ /**
+ * The Class PartAdditionalData.
+ */
+ protected class PartAdditionalData implements IClipboardAdditionalData {
+
+ /** The association. */
+ protected Association asssociation;
+
+ /**
+ * @param association
+ */
+ public PartAdditionalData(Association asssociation) {
+ this.asssociation = duplicateAssociation(asssociation);
+ }
+
+ /**
+ * @return a copy of the association
+ */
+ public Association getDuplicatedAssociation() {
+ return duplicateAssociation(asssociation);
+ }
+
+ }
+
+ /**
+ * The Class PartBlockAdditionalData.
+ */
+ protected class PartBlockAdditionalData implements IClipboardAdditionalData {
+
+ /** The associations by property name. */
+ protected Map<String, Association> mapPropertyNameToAssociation;
+
+ /**
+ * @param block
+ */
+ public PartBlockAdditionalData(Classifier block) {
+ this.mapPropertyNameToAssociation = new HashMap<String, Association>();
+ EList<Property> allAttributes = block.getAllAttributes();
+ for(Property property : allAttributes) {
+ Association association = property.getAssociation();
+ Association newAssociation = duplicateAssociation(association);
+ mapPropertyNameToAssociation.put(property.getName(), newAssociation);
+ }
+
+ }
+
+ /**
+ * @param propertyName
+ * @return a copy of the association
+ */
+ public Association getDuplicatedAssociationByPropertyName(String propertyName) {
+ Association association = mapPropertyNameToAssociation.get(propertyName);
+ return duplicateAssociation(association);
+ }
+ }
+}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
index 1c01988..12a7a67 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.common/META-INF/MANIFEST.MF
@@ -35,6 +35,7 @@ Export-Package: org.eclipse.papyrus.uml.diagram.common,
org.eclipse.papyrus.uml.diagram.common.service,
org.eclipse.papyrus.uml.diagram.common.service.palette,
org.eclipse.papyrus.uml.diagram.common.sheet,
+ org.eclipse.papyrus.uml.diagram.common.strategy.paste,
org.eclipse.papyrus.uml.diagram.common.ui.dialogs,
org.eclipse.papyrus.uml.diagram.common.ui.helper,
org.eclipse.papyrus.uml.diagram.common.util,
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath
index 23f23cf..969b403 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/.classpath
@@ -1,8 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="test"/>
- <classpathentry kind="src" path="test-gen"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="test"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java
index 165a332..1c38664 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/common/AbstractModelExplorerTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from Model
+ *
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.common;
@@ -20,7 +20,7 @@ import java.util.Collections;
import java.util.Iterator;
import java.util.List;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java
index e927a51..4b28cca 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteBlockTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from Block - Model
+ *
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
@@ -33,7 +33,7 @@ public abstract class AbstractCopyPasteBlockTest extends AbstractCopyPasteTest {
/**
* {@inheritDoc}
*
- * @generated
+ *
*/
@Override
protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
@@ -47,7 +47,7 @@ public abstract class AbstractCopyPasteBlockTest extends AbstractCopyPasteTest {
/**
* {@inheritDoc}
*
- * @generated
+ *
*/
@Override
protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java
index b22fd5e..6d185d8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPastePartTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from Part - Model
+ * from Part - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
@@ -30,7 +30,7 @@ public abstract class AbstractCopyPastePartTest extends AbstractCopyPasteTest {
/**
* {@inheritDoc}
- * @generated
+ *
*/
@Override
protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
@@ -43,14 +43,21 @@ public abstract class AbstractCopyPastePartTest extends AbstractCopyPasteTest {
/**
* {@inheritDoc}
- * @generated
+ *
*/
@Override
protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
super.postCopyAdditionalChecks(originalModel, newValues, delta);
/* post copy checks */
- Association newAssociation = ((Property)newValues.get(0)).getAssociation(); Assert.assertNotNull("New Part should have an association", newAssociation);
+
+ for(EObject newObject : newValues) {
+ if (newObject instanceof Property){
+ Property property = (Property) newObject;
+ Association newAssociation = property.getAssociation();
+ Assert.assertNotNull("New Part should have an association", newAssociation); //$NON-NLS-1$
+ }
+ }
/* END OF post copy checks */
}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java
index 86132c3..1ea66a8 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteReferenceTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from Reference - Model
+ * from Reference - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
@@ -31,7 +31,7 @@ public abstract class AbstractCopyPasteReferenceTest extends AbstractCopyPasteTe
/**
* {@inheritDoc}
- * @generated
+ *
*/
@Override
protected void initializeTest(Map<Object, Object> additionalChecks, EObject targetContainer, EObject copiedEObject) {
@@ -44,7 +44,7 @@ public abstract class AbstractCopyPasteReferenceTest extends AbstractCopyPasteTe
/**
* {@inheritDoc}
- * @generated
+ *
*/
@Override
protected void postCopyAdditionalChecks(Map<?, ?> originalModel, List<EObject> newValues, List<EObject> delta) throws Exception {
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java
index ce272d6..cef2d87 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/AbstractCopyPasteTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from Model
+ * from Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
@@ -19,7 +19,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import junit.framework.Assert;
+import org.junit.Assert;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.emf.ecore.EObject;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java
index f1fc8a8..ec838f4 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlock2Test.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from SimpleBlock2 - Model
+ * from SimpleBlock2 - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java
index 689dc65..e9d9582 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleBlockTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from SimpleBlock - Model
+ * from SimpleBlock - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java
index c0cde11..d3c63e2 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimplePartTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from SimplePart - Model
+ * from SimplePart - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java
index 982bf21..ebf2450d 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/copypaste/CopyPasteSimpleReferenceTest.java
@@ -9,7 +9,7 @@
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
*
- * @Generated from SimpleReference - Model
+ * from SimpleReference - Model
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.copypaste;
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java
index ae8eb63..e8a9f2f 100644
--- a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test-gen/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.modelexplorer.tests/test/org/eclipse/papyrus/sysml/modelexplorer/tests/suites/AllCopyPasteTests.java
@@ -8,7 +8,7 @@
*
* Contributors:
* Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
- * @generated
+ *
*****************************************************************************/
package org.eclipse.papyrus.sysml.modelexplorer.tests.suites;
@@ -23,7 +23,7 @@ import org.junit.runners.Suite.SuiteClasses;
/**
* Tests suite for Copy/Paste
- * @generated
+ *
*/
@RunWith(Suite.class)
@SuiteClasses({