Class AbstractChangeFactory
java.lang.Object
org.eclipse.emf.compare.internal.postprocessor.factories.AbstractChangeFactory
- All Implemented Interfaces:
IChangeFactory
Factory of difference extensions.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Diff
It creates the graphical change extension.void
fillRequiredDifferences
(Comparison comparison, Diff extension) Sets the required link of the difference extension created by the related factory.
It has to be called when all the extensions are created.findCrossReferences
(Comparison comparison, EObject lookup, com.google.common.base.Predicate<Diff> p) Find the differences, on the given model object, which match with the predicate.getAllContainedDifferences
(Diff input) Get all the add and delete changes on the objects contained in the one concerned by the given difference.Returns the kind of extension that this factory has to create.getParentMatch
(Diff input) Returns the match in which the difference will be added.protected DifferenceKind
getRelatedExtensionKind
(Diff input) Get theDifferenceKind
of the matching diagram difference extension in relation to the given difference.boolean
Returns true if this factory handles the given kind of Diff, i.e., if it can create anextension
.protected boolean
Check if the given attribute change is related to a graphical add.protected boolean
Check if the given reference change is related to a graphical add.protected boolean
Check if the given resource attachment change is related to a graphical add.protected boolean
Check if the given attribute change is related to a graphical change.protected boolean
Check if the given reference change is related to a graphical change.protected boolean
Check if the given resource attachment change is related to a graphical change.protected boolean
Check if the given attribute change is related to a graphical delete.protected boolean
Check if the given reference change is related to a graphical delete.protected boolean
Check if the given resource attachment change is related to a graphical delete.protected boolean
Check if the given attribute change is related to a graphical move.protected boolean
Check if the given reference change is related to a graphical move.protected boolean
Check if the given resource attachment change is related to a graphical ;ove.abstract void
setRefiningChanges
(Diff extension, DifferenceKind extensionKind, Diff refiningDiff) Get the refining differences and set the given extension with them, from the given refining one.
-
Constructor Details
-
AbstractChangeFactory
public AbstractChangeFactory()
-
-
Method Details
-
handles
Returns true if this factory handles the given kind of Diff, i.e., if it can create anextension
.Performance note: this method should return as quickly as possible as it will called on every
Diff
of the Comparison.- Specified by:
handles
in interfaceIChangeFactory
- Parameters:
input
- the element to test- Returns:
- true if this factory handles the given input, false otherwise.
- See Also:
-
create
Creates and returns aextension
from the givenDiff
. The returned element MUST NOT be added to its parent, it will be done by the post processor.- Specified by:
create
in interfaceIChangeFactory
- Parameters:
input
- The input difference element.- Returns:
- The difference extension.
- See Also:
-
createExtension
It creates the graphical change extension.- Returns:
- The extension.
-
setRefiningChanges
public abstract void setRefiningChanges(Diff extension, DifferenceKind extensionKind, Diff refiningDiff) Get the refining differences and set the given extension with them, from the given refining one.- Parameters:
extension
- The extension to set.extensionKind
- The extension kind.refiningDiff
- The refining difference.
-
getParentMatch
Returns the match in which the difference will be added.- Specified by:
getParentMatch
in interfaceIChangeFactory
- Parameters:
input
- The input difference element.- Returns:
- The difference extension.
- See Also:
-
getExtensionKind
Returns the kind of extension that this factory has to create.- Specified by:
getExtensionKind
in interfaceIChangeFactory
- Returns:
- The kind of extension.
- See Also:
-
fillRequiredDifferences
Sets the required link of the difference extension created by the related factory.
It has to be called when all the extensions are created.- Specified by:
fillRequiredDifferences
in interfaceIChangeFactory
- Parameters:
comparison
- The comparison.extension
- The difference extension.- See Also:
-
getRelatedExtensionKind
Get theDifferenceKind
of the matching diagram difference extension in relation to the given difference.- Parameters:
input
- The given difference.- Returns:
- The kind of the diagram difference extension if this one exists, null otherwise.
-
isRelatedToAnExtensionAdd
Check if the given reference change is related to a graphical add. It may be overridden in the child factories in order to precise which kind of graphical add has to be considered.- Parameters:
input
- The reference change.- Returns:
- True if the reference change is a good candidate, false otherwise.
-
isRelatedToAnExtensionDelete
Check if the given reference change is related to a graphical delete. It may be overridden in the child factories in order to precise which kind of graphical delete has to be considered.- Parameters:
input
- The reference change.- Returns:
- True if the reference change is a good candidate, false otherwise.
-
isRelatedToAnExtensionChange
Check if the given reference change is related to a graphical change. It may be overridden in the child factories in order to precise which kind of graphical change has to be considered.- Parameters:
input
- The reference change.- Returns:
- True if the reference change is a good candidate, false otherwise.
-
isRelatedToAnExtensionMove
Check if the given reference change is related to a graphical move. It may be overridden in the child factories in order to precise which kind of graphical move has to be considered.- Parameters:
input
- The reference change.- Returns:
- True if the reference change is a good candidate, false otherwise.
-
isRelatedToAnExtensionAdd
Check if the given attribute change is related to a graphical add. It may be overridden in the child factories in order to precise which kind of graphical add has to be considered.- Parameters:
input
- The attribute change.- Returns:
- True if the attribute change is a good candidate, false otherwise.
-
isRelatedToAnExtensionDelete
Check if the given attribute change is related to a graphical delete. It may be overridden in the child factories in order to precise which kind of graphical delete has to be considered.- Parameters:
input
- The attribute change.- Returns:
- True if the attribute change is a good candidate, false otherwise.
-
isRelatedToAnExtensionChange
Check if the given attribute change is related to a graphical change. It may be overridden in the child factories in order to precise which kind of graphical change has to be considered.- Parameters:
input
- The attribute change.- Returns:
- True if the attribute change is a good candidate, false otherwise.
-
isRelatedToAnExtensionMove
Check if the given attribute change is related to a graphical move. It may be overridden in the child factories in order to precise which kind of graphical move has to be considered.- Parameters:
input
- The attribute change.- Returns:
- True if the attribute change is a good candidate, false otherwise.
-
isRelatedToAnExtensionAdd
Check if the given resource attachment change is related to a graphical add. It may be overridden in the child factories in order to precise which kind of graphical add has to be considered.- Parameters:
input
- The resource attachment change.- Returns:
- True if the resource attachment change is a good candidate, false otherwise.
-
isRelatedToAnExtensionDelete
Check if the given resource attachment change is related to a graphical delete. It may be overridden in the child factories in order to precise which kind of graphical delete has to be considered.- Parameters:
input
- The resource attachment change.- Returns:
- True if the resource attachment change is a good candidate, false otherwise.
-
isRelatedToAnExtensionChange
Check if the given resource attachment change is related to a graphical change. It may be overridden in the child factories in order to precise which kind of graphical change has to be considered.- Parameters:
input
- The resource attachment change.- Returns:
- True if the resource attachment change is a good candidate, false otherwise.
-
isRelatedToAnExtensionMove
Check if the given resource attachment change is related to a graphical ;ove. It may be overridden in the child factories in order to precise which kind of graphical ;ove has to be considered.- Parameters:
input
- The resource attachment change.- Returns:
- True if the resource attachment change is a good candidate, false otherwise.
-
getAllContainedDifferences
Get all the add and delete changes on the objects contained in the one concerned by the given difference.- Parameters:
input
- The given difference.- Returns:
- The found differences.
-
findCrossReferences
protected final List<Diff> findCrossReferences(Comparison comparison, EObject lookup, com.google.common.base.Predicate<Diff> p) Find the differences, on the given model object, which match with the predicate.- Parameters:
comparison
- The comparison.lookup
- The model object.p
- The predicate.- Returns:
- The found differences.
-