Ejemplo n.º 1
0
  public void unrelateAcrossR4202From(Component_c target, boolean notifyChanges) {
    if (target == null) return;

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

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

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

    if (CanBeNestedInComponent != null) {

      m_parent_id = CanBeNestedInComponent.getId();
      if (IdAssigner.NULL_UUID.equals(m_parent_id)) {
        m_parent_id = CanBeNestedInComponent.getIdCachedValue();
      }
      CanBeNestedInComponent = null;
      target.removeRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_UNRELATED, this, target, "4202", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 2
0
  public void relateAcrossR4202To(Component_c target, boolean notifyChanges) {
    if (target == null) return;

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

    if (CanBeNestedInComponent != target) {

      Object oldKey = getInstanceKey();

      if (CanBeNestedInComponent != null) {

        CanBeNestedInComponent.clearBackPointerR4202To(this);

        if (Boolean.valueOf(System.getenv("PTC_MCC_ENABLED")) == true) { // $NON-NLS-1$
          Ooaofooa.log.println(
              ILogger.CONSISTENCY,
              "ComponentInComponent_c.relateAcrossR4202To(Component_c target)",
              "Relate performed across R4202 from Component in Component to Component without unrelate of prior instance.");
        }
      }

      CanBeNestedInComponent = target;
      if (IdAssigner.NULL_UUID.equals(target.getId())) {
        // do not update cached value
      } else {
        // update cached value
        m_parent_id = target.getIdCachedValue();
      }
      updateInstanceKey(oldKey, getInstanceKey());
      target.setBackPointerR4202To(this);
      target.addRef();
      if (notifyChanges) {
        RelationshipChangeModelDelta change =
            new RelationshipChangeModelDelta(
                Modeleventnotification_c.DELTA_ELEMENT_RELATED, this, target, "4202", "");
        Ooaofooa.getDefaultInstance().fireModelElementRelationChanged(change);
      }
    }
  }
Ejemplo n.º 3
0
 public boolean evaluate(Object candidate) {
   Component_c selected = (Component_c) candidate;
   boolean retval = false;
   retval = (selected.getId().equals(m_p55683));
   return retval;
 }
Ejemplo n.º 4
0
 public java.util.UUID getParent_id() {
   if (CanBeNestedInComponent != null) {
     return CanBeNestedInComponent.getId();
   }
   return IdAssigner.NULL_UUID;
 }
 public java.util.UUID getId() {
   if (HeldByComponent != null) {
     return HeldByComponent.getId();
   }
   return IdAssigner.NULL_UUID;
 }