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
-
Field Summary
Fields inherited from interface org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.ITypedElement
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
-
Constructor Summary
ConstructorDescriptionAbstractStructuralFeatureAccessor
(AdapterFactory adapterFactory, Diff diff, IMergeViewer.MergeViewerSide side) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected com.google.common.collect.ImmutableList<Diff>
Compute the differences that apply on the structural feature.protected EStructuralFeature
getAffectedFeature
(Diff diff) Returns the structural feature affected by the given diff, if any.Returns the comparison object used by this accessor.protected final com.google.common.collect.ImmutableList<Diff>
Returns the list of diff that apply on the structural feature.Returns the EObject associated with the structural feature.org.eclipse.swt.graphics.Image
getImage()
Returns an image for this object.protected final Diff
Returns the initial diff associated with this accessor.Returns the initial item of this accessor.getName()
Returns the name of this object.protected final IMergeViewer.MergeViewerSide
getSide()
Returns the side of the accessor.Returns the structural feature for which an accessor is needed.getType()
Returns the type of this object.Methods inherited from class org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.impl.AbstractTypedElementAdapter
getAdapterFactory, getItemDelegator, getRootAdapterFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.ICompareAccessor
getItems
-
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
Returns the comparison object used by this accessor.- Specified by:
getComparison
in interfaceICompareAccessor
- Returns:
- the comparison object used by this accessor.
- See Also:
-
getInitialItem
Returns the initial item of this accessor.- Specified by:
getInitialItem
in interfaceICompareAccessor
- Returns:
- the initial item of this accessor.
- See Also:
-
getEObject
Returns the EObject associated with the structural feature.- Specified by:
getEObject
in interfaceIStructuralFeatureAccessor
- 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
Returns the structural feature for which an accessor is needed.- Specified by:
getStructuralFeature
in interfaceIStructuralFeatureAccessor
- Returns:
- the structural feature for which an accessor is needed.
- See Also:
-
getSide
Returns the side of the accessor.- Returns:
- the side of the accessor.
-
getDifferences
Returns the list of diff that apply on the structural feature.- Returns:
- the list of diff that apply on the structural feature.
-
computeDifferences
Compute the differences that apply on the structural feature.- Returns:
- the list of diff that apply on the structural feature.
-
getAffectedFeature
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
Returns the initial diff associated with this accessor.- Returns:
- the initial diff.
-
getName
Returns the name of this object. The name is used when displaying this object in the UI.- Specified by:
getName
in interfaceITypedElement
- 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 interfaceITypedElement
- Returns:
- the image of this object or
null
if this type of input has no image - See Also:
-
getType
Returns the type of this object. For objects with a file name this is typically the file extension. For folders its the constantFOLDER_TYPE
. The type is used for determining a suitable viewer for this object.- Specified by:
getType
in interfaceITypedElement
- Returns:
- the type of this object
- See Also:
-