|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.emf.compare.diff.merge.DefaultMerger
public class DefaultMerger
Basic implementation of an IMerger. Clients can extend this class instead of implementing IMerger
to avoid reimplementing all methods.
| Field Summary | |
|---|---|
protected DiffElement |
diff
DiffElement to be merged by this merger. |
protected org.eclipse.emf.ecore.resource.Resource |
leftResource
Deprecated. |
protected org.eclipse.emf.ecore.resource.Resource |
rightResource
Deprecated. |
| Constructor Summary | |
|---|---|
DefaultMerger()
|
|
| Method Summary | |
|---|---|
void |
applyInOrigin()
Applies the modification in the original (left) model. |
boolean |
canApplyInOrigin()
Returns True if the merger is allowed to apply changes in the origin (left) model. |
boolean |
canUndoInTarget()
Returns True if the merger is allowed to undo changes in the target (right) model. |
protected void |
cleanDiffGroup(DiffGroup diffGroup)
Removes the given DiffGroup from its container if it was its last child, also calls for the
same cleanup operation on its hierarchy. |
protected org.eclipse.emf.ecore.EObject |
copy(org.eclipse.emf.ecore.EObject eObject)
Creates a copy of the given EObject as would EcoreUtil.copy(EObject) would, except we use
specific handling for unmatched references. |
protected org.eclipse.emf.ecore.resource.Resource |
findLeftResource()
Deprecated. this will be removed before 1.0 is released. Resources should be computed directly from the mergers as we now have whole ResourceSets to consider. |
protected org.eclipse.emf.ecore.resource.Resource |
findRightResource()
Deprecated. this will be removed before 1.0 is released. Resources should be computed directly from the mergers as we now have whole ResourceSets to consider. |
protected DiffModel |
getDiffModel()
Returns the DiffModel containing the DiffElement this merger is intended to merge. |
protected java.lang.String |
getXMIID(org.eclipse.emf.ecore.EObject object)
Returns the XMI ID of the given EObject or null if it cannot be resolved. |
protected void |
removeDanglingReferences(org.eclipse.emf.ecore.EObject deletedObject)
Removes all references to the given EObject from the DiffModel. |
protected void |
removeFromContainer(DiffElement diffElement)
Removes a DiffElement from its DiffGroup. |
void |
setDiffElement(DiffElement element)
Sets the DiffElement to be merged. |
protected void |
setXMIID(org.eclipse.emf.ecore.EObject object,
java.lang.String id)
Sets the XMI ID of the given EObject if it belongs in an XMIResource. |
void |
undoInTarget()
Cancels the modification in the target (right) model. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected DiffElement diff
DiffElement to be merged by this merger.
@Deprecated protected org.eclipse.emf.ecore.resource.Resource leftResource
@Deprecated protected org.eclipse.emf.ecore.resource.Resource rightResource
| Constructor Detail |
|---|
public DefaultMerger()
| Method Detail |
|---|
public void applyInOrigin()
applyInOrigin in interface IMergerIMerger.applyInOrigin()public boolean canApplyInOrigin()
True if the merger is allowed to apply changes in the origin (left) model.
canApplyInOrigin in interface IMergerTrue if the merger is allowed to apply changes in the origin (left) model,
False otherwise.IMerger.canApplyInOrigin()public boolean canUndoInTarget()
True if the merger is allowed to undo changes in the target (right) model.
canUndoInTarget in interface IMergerTrue if the merger is allowed to undo changes in the target (right) model,
False otherwise.IMerger.canUndoInTarget()public void setDiffElement(DiffElement element)
DiffElement to be merged.
setDiffElement in interface IMergerelement - The DiffElement to be merged.IMerger.setDiffElement(org.eclipse.emf.compare.diff.metamodel.DiffElement)public void undoInTarget()
undoInTarget in interface IMergerIMerger.undoInTarget()protected void cleanDiffGroup(DiffGroup diffGroup)
DiffGroup from its container if it was its last child, also calls for the
same cleanup operation on its hierarchy.
diffGroup - DiffGroup we want to cleanup.protected org.eclipse.emf.ecore.EObject copy(org.eclipse.emf.ecore.EObject eObject)
EcoreUtil.copy(EObject) would, except we use
specific handling for unmatched references.
eObject - The object to copy.
@Deprecated protected org.eclipse.emf.ecore.resource.Resource findLeftResource()
@Deprecated protected org.eclipse.emf.ecore.resource.Resource findRightResource()
protected DiffModel getDiffModel()
DiffModel containing the DiffElement this merger is intended to merge.
DiffModel containing the DiffElement this merger is intended to merge.protected java.lang.String getXMIID(org.eclipse.emf.ecore.EObject object)
EObject or null if it cannot be resolved.
object - Object which we seek the XMI ID of.
object's XMI ID, null if not applicable.protected void removeDanglingReferences(org.eclipse.emf.ecore.EObject deletedObject)
EObject from the DiffModel.
deletedObject - Object to remove all references to.protected void removeFromContainer(DiffElement diffElement)
DiffElement from its DiffGroup.
diffElement - DiffElement to remove from its container.
protected void setXMIID(org.eclipse.emf.ecore.EObject object,
java.lang.String id)
EObject if it belongs in an XMIResource.
object - Object we want to set the XMI ID of.id - XMI ID to give to object.
|
Copyright 2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||