List<?> incoming = part.getSourceConnections();
List<?> outgoing = part.getTargetConnections();
if (!incoming.isEmpty() || !outgoing.isEmpty()) {
CompoundCommand compound = new CompoundCommand();
for (Object obj : incoming) {
DeleteCommand command = new DeleteCommand(
((EdgeEditPart) obj).getModel());
compound.add(command);
}
for (Object obj : outgoing) {
DeleteCommand command = new DeleteCommand(
((EdgeEditPart) obj).getModel());
compound.add(command);
}
DeleteCommand command = new DeleteCommand(getHost().getModel());
compound.add(command);
return compound;
}
}
DeleteCommand command = new DeleteCommand(getHost().getModel());
return command;
}