Class AbstractStructuralFeatureAccessor

java.lang.Object
org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.impl.AbstractTypedElementAdapter
org.eclipse.emf.compare.rcp.ui.internal.contentmergeviewer.accessor.impl.AbstractStructuralFeatureAccessor
All Implemented Interfaces:
ICompareAccessor, IStructuralFeatureAccessor, ITypedElement
Direct Known Subclasses:
ContainmentReferenceChangeAccessorImpl, FeatureMapKeyChangeAccessorImpl, ManyStructuralFeatureAccessorImpl, SingleStructuralFeatureAccessorImpl

public abstract class AbstractStructuralFeatureAccessor extends AbstractTypedElementAdapter implements IStructuralFeatureAccessor
An abstract implementation of IStructuralFeatureAccessor.
Since:
4.0
  • Constructor Details

    • AbstractStructuralFeatureAccessor

      public AbstractStructuralFeatureAccessor(AdapterFactory adapterFactory, Diff diff, IMergeViewer.MergeViewerSide side)
      Default constructor.
      Parameters:
      adapterFactory - the adapater factory used to create the accessor.
      diff - the diff associated with this accessor.
      side - the side of the accessor.
  • Method Details

    • getComparison

      public Comparison getComparison()
      Returns the comparison object used by this accessor.
      Specified by:
      getComparison in interface ICompareAccessor
      Returns:
      the comparison object used by this accessor.
      See Also:
    • getInitialItem

      public IMergeViewerItem getInitialItem()
      Returns the initial item of this accessor.
      Specified by:
      getInitialItem in interface ICompareAccessor
      Returns:
      the initial item of this accessor.
      See Also:
    • getEObject

      public EObject getEObject(IMergeViewer.MergeViewerSide side)
      Returns the EObject associated with the structural feature.
      Specified by:
      getEObject in interface IStructuralFeatureAccessor
      Parameters:
      side - the side of the content merge viewer for which we want the EObject associated with the structural feature.
      Returns:
      the EObject associated with the structural feature.
      See Also:
    • getStructuralFeature

      public EStructuralFeature getStructuralFeature()
      Returns the structural feature for which an accessor is needed.
      Specified by:
      getStructuralFeature in interface IStructuralFeatureAccessor
      Returns:
      the structural feature for which an accessor is needed.
      See Also:
    • getSide

      protected final IMergeViewer.MergeViewerSide getSide()
      Returns the side of the accessor.
      Returns:
      the side of the accessor.
    • getDifferences

      protected final com.google.common.collect.ImmutableList<Diff> getDifferences()
      Returns the list of diff that apply on the structural feature.
      Returns:
      the list of diff that apply on the structural feature.
    • computeDifferences

      protected com.google.common.collect.ImmutableList<Diff> computeDifferences()
      Compute the differences that apply on the structural feature.
      Returns:
      the list of diff that apply on the structural feature.
    • getAffectedFeature

      protected EStructuralFeature getAffectedFeature(Diff diff)
      Returns the structural feature affected by the given diff, if any.
      Parameters:
      diff - The diff from which we need to retrieve a feature.
      Returns:
      The feature affected by this diff, if any. null if none.
    • getInitialDiff

      protected final Diff getInitialDiff()
      Returns the initial diff associated with this accessor.
      Returns:
      the initial diff.
    • getName

      public String getName()
      Returns the name of this object. The name is used when displaying this object in the UI.
      Specified by:
      getName in interface ITypedElement
      Returns:
      the name of this object
      See Also:
    • getImage

      public org.eclipse.swt.graphics.Image getImage()
      Returns an image for this object. This image is used when displaying this object in the UI.
      Specified by:
      getImage in interface ITypedElement
      Returns:
      the image of this object or null if this type of input has no image
      See Also:
    • getType

      public String getType()
      Returns the type of this object. For objects with a file name this is typically the file extension. For folders its the constant FOLDER_TYPE. The type is used for determining a suitable viewer for this object.
      Specified by:
      getType in interface ITypedElement
      Returns:
      the type of this object
      See Also: