use of org.eclipse.gmf.runtime.emf.clipboard.core.PostPasteChildOperation in project statecharts by Yakindu.
the class PositionalGeneralViewPasteOperation method getPostPasteOperation.
public PasteChildOperation getPostPasteOperation() {
return new PostPasteChildOperation(this, EMPTY_ARRAY) {
public void paste() throws Exception {
// unset connectors before pasting so that it won't affect
// real connectors especially if they happen to belong to the
// same
// target diagram
Node view = (Node) getEObject();
view.eUnset(NotationPackage.eINSTANCE.getView_SourceEdges());
view.eUnset(NotationPackage.eINSTANCE.getView_TargetEdges());
// now paste view
EObject pastedElement = doPasteInto(getParentEObject());
// did we succeed?
if (pastedElement != null) {
setPastedElement(pastedElement);
addPastedElement(pastedElement);
} else {
addPasteFailuresObject(getEObject());
}
}
protected boolean shouldPasteAlwaysCopyObject(ObjectInfo alwaysCopyObjectInfo) {
return PositionalGeneralViewPasteOperation.this.shouldPasteAlwaysCopyObject(alwaysCopyObjectInfo);
}
/*
* (non-Javadoc)
*
* @see org.eclipse.gmf.runtime.emf.core.internal.copypaste.
* PasteChildOperation
* #makeAuxiliaryChildPasteProcess(org.eclipse.gmf
* .runtime.emf.core.internal.copypaste.ObjectInfo)
*/
@SuppressWarnings("restriction")
protected PasteChildOperation makeAuxiliaryChildPasteProcess(ObjectInfo auxiliaryChildEObjectInfo) {
EObject semanticPasteTarget = NotationClipboardOperationHelper.getSemanticPasteTarget((View) getPastedElement());
if (semanticPasteTarget == null) {
return null;
}
return new PasteChildOperation(getParentPasteProcess().clone(semanticPasteTarget), auxiliaryChildEObjectInfo);
}
public PasteChildOperation getPostPasteOperation() {
List operations = getAlwaysCopyObjectPasteOperations();
return new PostPasteChildOperation(this, operations);
}
};
}
Aggregations