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
AITypedElementthat can be used as input of TextMergeViewer. The returned content is the value of the givenEAttributeon the givenEObject.- 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 StringAttributeChangeAccessor(EObject eObject, AttributeChange attributeChange)Creates a new accessor for the giveneObjectandeAttribute.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStreamgetContents()Returns an openInputStreamfor this object which can be used to retrieve the object's content.protected EAttributegetEAtribute()Returns the EAttribute to retrieve from the wrapped EObject.protected EObjectgetEObject()Returns the EObject to get the value of the EAttribute from.org.eclipse.swt.graphics.ImagegetImage()Returns an image for this object.StringgetName()Returns the name of this object.StringgetType()Returns the type of this object.
-
-
-
Constructor Detail
-
StringAttributeChangeAccessor
public StringAttributeChangeAccessor(EObject eObject, AttributeChange attributeChange)
Creates a new accessor for the giveneObjectandeAttribute.- Parameters:
eObject- The EObject to get the value of the EAttribute from.attributeChange- The attribute change to get the attribute Eattribute from.
-
-
Method Detail
-
getContents
public InputStream getContents() throws org.eclipse.core.runtime.CoreException
Returns an openInputStreamfor this object which can be used to retrieve the object's content. The client is responsible for closing the stream when finished. Returnsnullif this object has no streamable contents.- Specified by:
getContentsin 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:
IStreamContentAccessor.getContents()
-
getEObject
protected final EObject getEObject()
Returns the EObject to get the value of the EAttribute from.- Returns:
- the EObject to get the value of the EAttribute from.
-
getEAtribute
protected final EAttribute getEAtribute()
Returns the EAttribute to retrieve from the wrapped EObject.- Returns:
- the EAttribute to retrieve from the wrapped EObject.
-
getName
public String getName()
Returns the name of this object. The name is used when displaying this object in the UI.- Specified by:
getNamein 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:
getImagein interfaceITypedElement- Returns:
- the image of this object or
nullif 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:
getTypein interfaceITypedElement- Returns:
- the type of this object
- See Also:
ITypedElement.getType()
-
-