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());
  }