if (toDelete[i] instanceof ArcModel) {
allPorts.add(toDelete[i]);
editor.getModelProcessor().removeArc(((ArcModel) toDelete[i]).getId());
} else
if (toDelete[i] instanceof TriggerModel) {
TransitionModel owner = (TransitionModel) editor.getModelProcessor().getElementContainer()
.getElementById(((TriggerModel) toDelete[i]).getOwnerId());
if (owner != null) {
if (owner.getToolSpecific().getTrigger().getTriggertype() == TriggerModel.TRIGGER_RESOURCE
&& owner.getToolSpecific().getTransResource() != null) {
owner.getToolSpecific().removeTransResource();
}
owner.getToolSpecific().removeTrigger();
}
allPorts.add(toDelete[i]);
} else
if (toDelete[i] instanceof TransitionResourceModel) {
TransitionModel owner = (TransitionModel) editor.getModelProcessor().getElementContainer()
.getElementById(((TransitionResourceModel) toDelete[i]).getOwnerId());
if (owner != null) {
owner.getToolSpecific().removeTransResource();
}
allPorts.add(toDelete[i]);
} else
if (toDelete[i] instanceof NameModel) {
allPorts.add(toDelete[i]);