Ejemplo n.º 1
0
  /**
   * Add a condition on the MOS container
   *
   * @generated NOT
   */
  @Override
  public boolean canExecute() {
    if (source == null && target == null) {
      return false;
    }
    if (source != null && false == source instanceof Element) {
      return false;
    }
    if (target != null && false == target instanceof Element) {
      return false;
    }
    if (getSource() == null) {
      return true; // link creation is in progress; source is not defined yet
    }
    // target may be null here but it's possible to check constraint
    if (getContainer() == null) {
      return false;
    }

    if (getSource() != null && getTarget() != null) {
      if (!CommandHelper.hasValidContainer(getRequest())) {
        return false;
      }
    }

    return UMLBaseItemSemanticEditPolicy.getLinkConstraints()
        .canCreateMessage_4003(getContainer(), getSource(), getTarget());
  }
Ejemplo n.º 2
0
 /** @generated NOT */
 protected boolean canReorientSource() {
   if (!(oldEnd instanceof Element && newEnd instanceof Element)) {
     return false;
   }
   if (!(getLink().eContainer() instanceof Interaction)) {
     return false;
   }
   Interaction container = (Interaction) getLink().eContainer();
   return UMLBaseItemSemanticEditPolicy.getLinkConstraints()
       .canExistMessage_4003(container, getLink(), getNewSource(), getOldTarget());
 }