Esempio n. 1
0
  public void unrelateAcrossR1013From(MessageArgument_c target, boolean notifyChanges) {
    if (target == null) return;

    if (IsSupertypeMessageArgument == null) return; // already unrelated

    if (target != IsSupertypeMessageArgument) {
      Exception e = new Exception();
      e.fillInStackTrace();
      CorePlugin.logError("Tried to unrelate from non-related instance across R1013", e);
      return;
    }

    if (target != null) {
      target.clearBackPointerR1013To(this);
    }

    if (IsSupertypeMessageArgument != null) {

      m_arg_id = IsSupertypeMessageArgument.getArg_id();
      IsSupertypeMessageArgument = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "1013", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Esempio n. 2
0
  public void relateAcrossR1013To(MessageArgument_c target, boolean notifyChanges) {
    if (target == null) return;

    if (target == IsSupertypeMessageArgument) return; // already related

    if (IsSupertypeMessageArgument != target) {

      Object oldKey = getInstanceKey();

      if (IsSupertypeMessageArgument != null) {

        IsSupertypeMessageArgument.clearBackPointerR1013To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "InformalArgument_c.relateAcrossR1013To(MessageArgument_c target)",
              "Relate performed across R1013 from Informal Argument to Message Argument without unrelate of prior instance.");
        }
      }

      IsSupertypeMessageArgument = target;
      m_arg_id = target.getArg_id();
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR1013To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "1013", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }