Class ResourceContentsAccessorImpl
- java.lang.Object
-
- org.eclipse.emf.compare.rcp.ui.contentmergeviewer.accessor.legacy.impl.AbstractTypedElementAdapter
-
- org.eclipse.emf.compare.rcp.ui.internal.contentmergeviewer.accessor.impl.ResourceContentsAccessorImpl
-
- All Implemented Interfaces:
ICompareAccessor
,IResourceContentsAccessor
,ITypedElement
public class ResourceContentsAccessorImpl extends AbstractTypedElementAdapter implements IResourceContentsAccessor
A specificIResourceContentsAccessor
forResourceAttachmentChange
objects.- 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
Constructors Constructor Description ResourceContentsAccessorImpl(AdapterFactory adapterFactory, Diff diff, IMergeViewer.MergeViewerSide side)
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Comparison
getComparison()
Returns the comparison object used by this accessor.org.eclipse.swt.graphics.Image
getImage()
Returns an image for this object.IMergeViewerItem
getInitialItem()
Returns the initial item of this accessor.com.google.common.collect.ImmutableList<? extends IMergeViewerItem>
getItems()
Returns the list of items known by this accessor.String
getName()
Returns the name of this object.Resource
getResource(IMergeViewer.MergeViewerSide side)
Returns the resource of the model involved with the accessor given the side of the content merge viewer for which we want to know the resource.protected IMergeViewer.MergeViewerSide
getSide()
Returns the side of the content merge viewer on which the difference is performed.String
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
-
-
-
-
Constructor Detail
-
ResourceContentsAccessorImpl
public ResourceContentsAccessorImpl(AdapterFactory adapterFactory, Diff diff, IMergeViewer.MergeViewerSide side)
Default constructor.- Parameters:
adapterFactory
- the adapter factory used to create the accessor.diff
- The difference performed.side
- The side on which the difference is located.
-
-
Method Detail
-
getComparison
public Comparison getComparison()
Returns the comparison object used by this accessor.- Specified by:
getComparison
in interfaceICompareAccessor
- Returns:
- the comparison object used by this accessor.
- See Also:
ICompareAccessor.getComparison()
-
getInitialItem
public IMergeViewerItem getInitialItem()
Returns the initial item of this accessor.- Specified by:
getInitialItem
in interfaceICompareAccessor
- Returns:
- the initial item of this accessor.
- See Also:
ICompareAccessor.getInitialItem()
-
getItems
public com.google.common.collect.ImmutableList<? extends IMergeViewerItem> getItems()
Returns the list of items known by this accessor.- Specified by:
getItems
in interfaceICompareAccessor
- Returns:
- the list of items known by this accessor.
- See Also:
ICompareAccessor.getItems()
-
getResource
public Resource getResource(IMergeViewer.MergeViewerSide side)
Returns the resource of the model involved with the accessor given the side of the content merge viewer for which we want to know the resource.- Specified by:
getResource
in interfaceIResourceContentsAccessor
- Parameters:
side
- the side of the content merge viewer for which we want the resource.- Returns:
- the resource of the model involved with the accessor.
- See Also:
IResourceContentsAccessor.getResource(org.eclipse.emf.compare.rcp.ui.mergeviewer.IMergeViewer.MergeViewerSide)
-
getSide
protected final IMergeViewer.MergeViewerSide getSide()
Returns the side of the content merge viewer on which the difference is performed.- Returns:
- The side of the content merge viewer on which the difference is performed.
-
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 interfaceITypedElement
- Returns:
- the name of this object
- See Also:
ITypedElement.getName()
-
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:
ITypedElement.getImage()
-
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 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:
ITypedElement.getType()
-
-