Class AbstractChangeFactory

    • Constructor Detail

      • AbstractChangeFactory

        public AbstractChangeFactory()
    • Method Detail

      • handles

        public boolean handles​(Diff input)
        Returns true if this factory handles the given kind of Diff, i.e., if it can create an extension.

        Performance note: this method should return as quickly as possible as it will called on every Diff of the Comparison.

        Specified by:
        handles in interface IChangeFactory
        Parameters:
        input - the element to test
        Returns:
        true if this factory handles the given input, false otherwise.
        See Also:
        IChangeFactory.handles(org.eclipse.emf.compare.Diff)
      • createExtension

        public abstract Diff 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.
      • getRelatedExtensionKind

        protected DifferenceKind getRelatedExtensionKind​(Diff input)
        Get the DifferenceKind 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

        protected boolean isRelatedToAnExtensionAdd​(ReferenceChange input)
        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

        protected boolean isRelatedToAnExtensionDelete​(ReferenceChange input)
        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

        protected boolean isRelatedToAnExtensionChange​(ReferenceChange input)
        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

        protected boolean isRelatedToAnExtensionMove​(ReferenceChange input)
        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

        protected boolean isRelatedToAnExtensionAdd​(AttributeChange input)
        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

        protected boolean isRelatedToAnExtensionDelete​(AttributeChange input)
        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

        protected boolean isRelatedToAnExtensionChange​(AttributeChange input)
        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

        protected boolean isRelatedToAnExtensionMove​(AttributeChange input)
        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

        protected boolean isRelatedToAnExtensionAdd​(ResourceAttachmentChange input)
        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

        protected boolean isRelatedToAnExtensionDelete​(ResourceAttachmentChange input)
        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

        protected boolean isRelatedToAnExtensionChange​(ResourceAttachmentChange input)
        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

        protected boolean isRelatedToAnExtensionMove​(ResourceAttachmentChange input)
        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

        protected Set<Diff> getAllContainedDifferences​(Diff input)
        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.