/**
   * {@inheritDoc}
   *
   * @see
   *     org.eclipse.emf.compare.uml2.diff.internal.extension.IDiffExtensionFactory#create(org.eclipse.emf.compare.diff.metamodel.DiffElement,
   *     org.eclipse.emf.ecore.util.EcoreUtil.CrossReferencer)
   */
  public AbstractDiffExtension create(
      DiffElement input, EcoreUtil.CrossReferencer crossReferencer) {
    final ModelElementChangeLeftTarget changeLeftTarget = (ModelElementChangeLeftTarget) input;
    final Message message = (Message) changeLeftTarget.getLeftElement();

    final UMLMessageChangeLeftTarget ret =
        UML2DiffFactory.eINSTANCE.createUMLMessageChangeLeftTarget();

    final MessageEnd receiveEvent = message.getReceiveEvent();
    if (receiveEvent != null) {
      hideEvent(receiveEvent, ret, crossReferencer);
    }

    final MessageEnd sendEvent = message.getSendEvent();
    if (sendEvent != null) {
      hideEvent(sendEvent, ret, crossReferencer);
    }

    ret.getHideElements().add(changeLeftTarget);
    ret.getRequires().add(changeLeftTarget);

    ret.setRemote(changeLeftTarget.isRemote());
    ret.setRightParent(changeLeftTarget.getRightParent());
    ret.setLeftElement(changeLeftTarget.getLeftElement());

    return ret;
  }
 public static boolean canExist(Message message, Element source, Element target) {
   MessageSort messageSort = null;
   if (message != null) {
     messageSort = message.getMessageSort();
   }
   return canExist(message, messageSort, source, target);
 }
 public static boolean canReorientTarget(Message message, Element newTarget) {
   if (message == null || newTarget == null) {
     return false;
   }
   Element source = null;
   MessageEnd sendEvent = message.getSendEvent();
   if (sendEvent instanceof OccurrenceSpecification) {
     EList<Lifeline> covereds = ((OccurrenceSpecification) sendEvent).getCovereds();
     if (!covereds.isEmpty()) {
       source = covereds.get(0);
     }
   } else if (sendEvent instanceof Gate
       // special handling of SyncMessages due to #425666
       && MessageSort.SYNCH_CALL_LITERAL != message.getMessageSort()) {
     source = ((Gate) sendEvent).getOwner();
   }
   return canExist(message, source, newTarget);
 }
Example #4
0
 private static String getValue(Message e, int paramIndex, Parameter parameter) {
   try {
     EList<ValueSpecification> arguments = e.getArguments();
     if (arguments.size() > paramIndex) {
       return ValueSpecificationUtil.getSpecificationValue(arguments.get(paramIndex));
     }
   } catch (Exception e1) {
   }
   return null;
 }
 /**
  *
  * <!-- begin-user-doc -->
  * <!-- end-user-doc -->
  *
  * @generated
  */
 @Override
 public Message getBase_Message() {
   if (base_Message != null && base_Message.eIsProxy()) {
     InternalEObject oldBase_Message = (InternalEObject) base_Message;
     base_Message = (Message) eResolveProxy(oldBase_Message);
     if (base_Message != oldBase_Message) {
       if (eNotificationRequired()) {
         eNotify(
             new ENotificationImpl(
                 this,
                 Notification.RESOLVE,
                 TimePackage.TIMED_PROCESSING__BASE_MESSAGE,
                 oldBase_Message,
                 base_Message));
       }
     }
   }
   return base_Message;
 }