org.eclipse.emf.emfstore.internal.client.model.changeTracking
Class NotificationToOperationConverter

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.model.changeTracking.NotificationToOperationConverter

public final class NotificationToOperationConverter
extends Object

Converts an EMF notification to an Operation.

Author:
chodnick

Constructor Summary
NotificationToOperationConverter(IdEObjectCollectionImpl project)
          Default constructor.
 
Method Summary
 AbstractOperation convert(NotificationInfo n)
          Converts given notification to an operation.
static MultiReferenceOperation createMultiReferenceOperation(IdEObjectCollectionImpl collection, org.eclipse.emf.ecore.EObject modelElement, org.eclipse.emf.ecore.EReference reference, List<org.eclipse.emf.ecore.EObject> referencedElements, boolean isAdd, int position)
          Creates a multi reference operation based on the given information.
static SingleReferenceOperation createSingleReferenceOperation(IdEObjectCollectionImpl collection, ModelElementId oldReference, ModelElementId newReference, org.eclipse.emf.ecore.EReference reference, org.eclipse.emf.ecore.EObject modelElement)
          Creates a single reference operation based on the given information.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationToOperationConverter

public NotificationToOperationConverter(IdEObjectCollectionImpl project)
Default constructor.

Parameters:
project - project
Method Detail

convert

public AbstractOperation convert(NotificationInfo n)
Converts given notification to an operation. May return null if the notification signifies a no-op.

Parameters:
n - the notification to convert
Returns:
the operation or null

createMultiReferenceOperation

public static MultiReferenceOperation createMultiReferenceOperation(IdEObjectCollectionImpl collection,
                                                                    org.eclipse.emf.ecore.EObject modelElement,
                                                                    org.eclipse.emf.ecore.EReference reference,
                                                                    List<org.eclipse.emf.ecore.EObject> referencedElements,
                                                                    boolean isAdd,
                                                                    int position)
Creates a multi reference operation based on the given information.

Parameters:
collection - the collection the modelElement is contained in
modelElement - the model element holding the reference
reference - the actual reference
referencedElements - the elements referenced by the reference
isAdd - whether any referenced model elements were added to the collection
position - the index of the model element within the referenceElements affected by the generated operation
Returns:
a multi reference operation

createSingleReferenceOperation

public static SingleReferenceOperation createSingleReferenceOperation(IdEObjectCollectionImpl collection,
                                                                      ModelElementId oldReference,
                                                                      ModelElementId newReference,
                                                                      org.eclipse.emf.ecore.EReference reference,
                                                                      org.eclipse.emf.ecore.EObject modelElement)
Creates a single reference operation based on the given information.

Parameters:
collection - the collection the modelElement is contained in
oldReference - the ModelElementId of the model element the reference was pointing to
newReference - the ModelElementId of the model element the reference is now pointing to
reference - the actual reference
modelElement - the model element holding the reference
Returns:
a single reference operation


Copyright © 2015. All Rights Reserved.