diff --git a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java index 33814a339ae2660c9edbc6ed68bed82bb0abe6b8..f012bc98dce074f1958ca246b986aaa6e884733e 100644 --- a/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java +++ b/org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/CopyPasteUtils.java @@ -45,7 +45,7 @@ import org.fortiss.tooling.kernel.ui.dnd.CompositionServiceLocalCopyPasteTransfe * * @author $Author$ * @version $Rev$ - * @ConQAT.Rating YELLOW Hash: C10175C80531676B29BE8895D87819F2 + * @ConQAT.Rating YELLOW Hash: 24530D08B4CDBA8179A0F683AA700FDF */ public class CopyPasteUtils { @@ -69,10 +69,7 @@ public class CopyPasteUtils { EList<ISpeciallyCopyiable> specialSel = pickInstanceOf(ISpeciallyCopyiable.class, new BasicEList<EObject>(sel)); for(ISpeciallyCopyiable obj : specialSel) { - obj.completeCopyEnvironment(copier); - } - for(ISpeciallyCopyiable obj : specialSel) { - obj.copyConnections(copier); + obj.specialCopyHook(copier); } Clipboard clipboard = new Clipboard(Display.getDefault()); clipboard.setContents(new Object[] {content}, @@ -121,7 +118,7 @@ public class CopyPasteUtils { } for(EObject obj : getClipBoardContent()) { if(obj instanceof ISpeciallyCopyiable) { - ((ISpeciallyCopyiable)obj).copyConnections(copier); + ((ISpeciallyCopyiable)obj).specialCopyHook(copier); } } } diff --git a/org.fortiss.tooling.kernel/trunk/model/kernel.ecore b/org.fortiss.tooling.kernel/trunk/model/kernel.ecore index 6fec1389fb477b3ebe6594494d4fd589d4f256c6..1a99f9319311b91379bdf6623ba9385f9d32e3a7 100644 --- a/org.fortiss.tooling.kernel/trunk/model/kernel.ecore +++ b/org.fortiss.tooling.kernel/trunk/model/kernel.ecore @@ -102,20 +102,9 @@ </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="ISpeciallyCopyiable" abstract="true" interface="true"> - <eOperations name="completeCopyEnvironment"> + <eOperations name="specialCopyHook"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> - <details key="documentation" value="Hook to allow changing the copy map, typically by adding elements that are not copied but might still be necessary to preserve some information.
The typical example is to copy connections between elements: the top element containing the connections is not copied, but necessary to copy the connections."/> - </eAnnotations> - <eParameters name="copyMap"> - <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> - <eTypeArguments eClassifier="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/> - <eTypeArguments eClassifier="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EObject"/> - </eGenericType> - </eParameters> - </eOperations> - <eOperations name="copyConnections"> - <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> - <details key="documentation" value="Hook to allow copying the connections between elements.
Goes hand in hand with completeCopyEnvironment.
Typically, one first calls completeCopyEnvironment on all copied elements and then copyConnections to copy the connections."/> + <details key="documentation" value="Hook for the copy of elements which need a special treatement (e.g, copy of connections, avoiding the repetition of some characteristics due to a copy, etc.)"/> </eAnnotations> <eParameters name="copyMap"> <eGenericType eClassifier="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EMap"> diff --git a/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel b/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel index dacd48edfb9197986c16f14f7eff65a8a633aa82..1ec8dc0111f65989f634eba3f67424701e7dd7b7 100644 --- a/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel +++ b/org.fortiss.tooling.kernel/trunk/model/kernel.genmodel @@ -47,11 +47,8 @@ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute kernel.ecore#//IExternalDocumentReference/uri"/> </genClasses> <genClasses image="false" ecoreClass="kernel.ecore#//ISpeciallyCopyiable"> - <genOperations ecoreOperation="kernel.ecore#//ISpeciallyCopyiable/completeCopyEnvironment"> - <genParameters ecoreParameter="kernel.ecore#//ISpeciallyCopyiable/completeCopyEnvironment/copyMap"/> - </genOperations> - <genOperations ecoreOperation="kernel.ecore#//ISpeciallyCopyiable/copyConnections"> - <genParameters ecoreParameter="kernel.ecore#//ISpeciallyCopyiable/copyConnections/copyMap"/> + <genOperations ecoreOperation="kernel.ecore#//ISpeciallyCopyiable/specialCopyHook"> + <genParameters ecoreParameter="kernel.ecore#//ISpeciallyCopyiable/specialCopyHook/copyMap"/> </genOperations> </genClasses> </genPackages>