/* (non-Javadoc)
* @see org.eclipse.gef.editpolicies.ConnectionEditPolicy#getDeleteCommand(org.eclipse.gef.requests.GroupRequest)
*/
protected Command getDeleteCommand(GroupRequest request) {
if (getHost().getModel() instanceof StateTransition) {
DeleteStateTransitionCommand cmd = new DeleteStateTransitionCommand();
StateTransition t = (StateTransition) getHost().getModel();
cmd.setTransition(t);
cmd.setSource(t.getFromState());
cmd.setTarget(t.getToState());
return cmd;
}
else if (getHost().getModel() instanceof IfTransition) {
IfTransition t = (IfTransition) getHost().getModel();
if (!t.isThen()) {
DeleteIfTransitionCommand cmd = new DeleteIfTransitionCommand();
cmd.setTransition(t);
cmd.setSource(t.getFromIf());
cmd.setTarget(t.getToState());
return cmd;
}
}
return null;
}