if (eu.admire.visual.pmml.treemodel._40.diagram.part.PMMLVisualIDRegistry
.getVisualID(incomingLink) == eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.NodeTypeNodeEditPart.VISUAL_ID) {
DestroyReferenceRequest r = new DestroyReferenceRequest(
incomingLink.getSource().getElement(), null,
incomingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(r) {
protected CommandResult doExecuteWithResult(
IProgressMonitor progressMonitor, IAdaptable info)
throws ExecutionException {
EObject referencedObject = getReferencedObject();
Resource resource = referencedObject.eResource();
CommandResult result = super.doExecuteWithResult(
progressMonitor, info);
if (resource != null) {
resource.getContents().add(referencedObject);
}
return result;
}
});
cmd.add(new DeleteCommand(getEditingDomain(), incomingLink));
continue;
}
}
for (Iterator it = view.getSourceEdges().iterator(); it.hasNext();) {
Edge outgoingLink = (Edge) it.next();
if (eu.admire.visual.pmml.treemodel._40.diagram.part.PMMLVisualIDRegistry
.getVisualID(outgoingLink) == eu.admire.visual.pmml.treemodel._40.diagram.edit.parts.NodeTypeNodeEditPart.VISUAL_ID) {
DestroyReferenceRequest r = new DestroyReferenceRequest(
outgoingLink.getSource().getElement(), null,
outgoingLink.getTarget().getElement(), false);
cmd.add(new DestroyReferenceCommand(r) {
protected CommandResult doExecuteWithResult(
IProgressMonitor progressMonitor, IAdaptable info)
throws ExecutionException {
EObject referencedObject = getReferencedObject();
Resource resource = referencedObject.eResource();