public class StringAttributeChangeAccessor extends Object implements ITypedElement, IStreamContentAccessor
ITypedElement
that can be used as input of TextMergeViewer. The returned content is the value of
the given EAttribute
on the given EObject
.FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
Constructor and Description |
---|
StringAttributeChangeAccessor(EObject eObject,
AttributeChange attributeChange)
Creates a new accessor for the given
eObject and eAttribute . |
Modifier and Type | Method and Description |
---|---|
InputStream |
getContents()
Returns an open
InputStream for this object which can be used to retrieve the object's
content. |
protected EAttribute |
getEAtribute()
Returns the EAttribute to retrieve from the wrapped EObject.
|
protected EObject |
getEObject()
Returns the EObject to get the value of the EAttribute from.
|
org.eclipse.swt.graphics.Image |
getImage()
Returns an image for this object.
|
String |
getName()
Returns the name of this object.
|
String |
getType()
Returns the type of this object.
|
public StringAttributeChangeAccessor(EObject eObject, AttributeChange attributeChange)
eObject
and eAttribute
.eObject
- The EObject to get the value of the EAttribute from.attributeChange
- The attribute change to get the attribute Eattribute from.public InputStream getContents() throws org.eclipse.core.runtime.CoreException
InputStream
for this object which can be used to retrieve the object's
content. The client is responsible for closing the stream when finished. Returns null
if
this object has no streamable contents.getContents
in interface IStreamContentAccessor
org.eclipse.core.runtime.CoreException
- if the contents of this object could not be accessedIStreamContentAccessor.getContents()
protected final EObject getEObject()
protected final EAttribute getEAtribute()
public String getName()
getName
in interface ITypedElement
ITypedElement.getName()
public org.eclipse.swt.graphics.Image getImage()
getImage
in interface ITypedElement
null
if this type of input has no imageITypedElement.getImage()
public String getType()
FOLDER_TYPE
. The type is used for determining a suitable viewer
for this object.getType
in interface ITypedElement
ITypedElement.getType()
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.