Class StringAttributeChangeAccessor
java.lang.Object
org.eclipse.emf.compare.rcp.ui.internal.contentmergeviewer.accessor.impl.StringAttributeChangeAccessor
- All Implemented Interfaces:
IStreamContentAccessor
,ITypedElement
public class StringAttributeChangeAccessor
extends Object
implements ITypedElement, IStreamContentAccessor
A
ITypedElement
that can be used as input of TextMergeViewer. The returned content is the value of
the given EAttribute
on the given EObject
.- 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
ConstructorDescriptionStringAttributeChangeAccessor
(EObject eObject, AttributeChange attributeChange) Creates a new accessor for the giveneObject
andeAttribute
. -
Method Summary
Modifier and TypeMethodDescriptionReturns an openInputStream
for this object which can be used to retrieve the object's content.protected final EAttribute
Returns the EAttribute to retrieve from the wrapped EObject.protected final EObject
Returns the EObject to get the value of the EAttribute from.org.eclipse.swt.graphics.Image
getImage()
Returns an image for this object.getName()
Returns the name of this object.getType()
Returns the type of this object.
-
Constructor Details
-
StringAttributeChangeAccessor
Creates a new accessor for the giveneObject
andeAttribute
.- Parameters:
eObject
- The EObject to get the value of the EAttribute from.attributeChange
- The attribute change to get the attribute Eattribute from.
-
-
Method Details
-
getContents
Returns an openInputStream
for this object which can be used to retrieve the object's content. The client is responsible for closing the stream when finished. Returnsnull
if this object has no streamable contents.- Specified by:
getContents
in interfaceIStreamContentAccessor
- Returns:
- an input stream containing the contents of this object
- Throws:
org.eclipse.core.runtime.CoreException
- if the contents of this object could not be accessed- See Also:
-
getEObject
Returns the EObject to get the value of the EAttribute from.- Returns:
- the EObject to get the value of the EAttribute from.
-
getEAtribute
Returns the EAttribute to retrieve from the wrapped EObject.- Returns:
- the EAttribute to retrieve from the wrapped EObject.
-
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:
-