*/
protected Command getConnectionCompleteCommand(
CreateConnectionRequest request) {
if (request.getNewObject() instanceof IStateTransition) {
if (getHost().getModel() instanceof ITransitionableTo) {
StateTransitionCreateCommand cmd = (StateTransitionCreateCommand) request
.getStartCommand();
IState source = cmd.getSource();
ITransitionableTo target = (ITransitionableTo) getState();
if (!(target instanceof IInlineFlowState) && source.getElementParent().equals(target.getElementParent())) {
cmd.setTarget((ITransitionableTo) getState());
return cmd;
}
else {
return null;
}
}
}
else if (request.getNewObject() instanceof IIfTransition) {
if (getHost().getModel() instanceof ITransitionableTo) {
IfTransitionCreateCommand cmd = (IfTransitionCreateCommand) request
.getStartCommand();
cmd.setTarget((ITransitionableTo) getState());
return cmd;
}
}
return null;
}