|
|||||||||
| Home >> All >> org >> eclipse >> [ compare overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.eclipse.compare
Class ResourceNode

java.lang.Objectorg.eclipse.compare.BufferedContent
org.eclipse.compare.ResourceNode
- All Implemented Interfaces:
- IContentChangeNotifier, IEditableContent, IEncodedStreamContentAccessor, IModificationDate, IStreamContentAccessor, org.eclipse.compare.structuremergeviewer.IStructureComparator, ITypedElement
- public class ResourceNode
- extends BufferedContent
- implements IEncodedStreamContentAccessor, org.eclipse.compare.structuremergeviewer.IStructureComparator, ITypedElement, IEditableContent, IModificationDate
- extends BufferedContent
A ResourceNode wrappers an IResources so that it can be used
as input for the differencing engine (interfaces IStructureComparator and ITypedElement)
and the ReplaceWithEditionDialog (interfaces ITypedElement and IModificationDate).
Clients may instantiate this class; it is not intended to be subclassed.
| Field Summary | |
private java.util.ArrayList |
fChildren
|
private org.eclipse.core.resources.IResource |
fResource
|
| Fields inherited from class org.eclipse.compare.BufferedContent |
fContent |
| Fields inherited from interface org.eclipse.compare.ITypedElement |
FOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE |
| Constructor Summary | |
ResourceNode(org.eclipse.core.resources.IResource resource)
Creates a ResourceNode for the given resource. |
|
| Method Summary | |
protected org.eclipse.compare.structuremergeviewer.IStructureComparator |
createChild(org.eclipse.core.resources.IResource child)
This hook method is called from getChildren once for every
member of a container resource. |
protected java.io.InputStream |
createStream()
Returns an open stream if the corresponding resource implements the IStorage interface. |
boolean |
equals(java.lang.Object other)
Returns true if the other object is of type ITypedElement
and their names are identical. |
java.lang.String |
getCharset()
Returns the name of a charset encoding to be used when decoding this stream accessor's contents into characters. |
java.lang.Object[] |
getChildren()
Returns an iterator for all children of this object or null
if there are no children. |
java.io.InputStream |
getContents()
Returns an open InputStream for this object which can be used to retrieve the object's content. |
org.eclipse.swt.graphics.Image |
getImage()
Returns an image for this object. |
long |
getModificationDate()
Returns the modification time of this object. |
java.lang.String |
getName()
Returns the name of this object. |
org.eclipse.core.resources.IResource |
getResource()
Returns the corresponding resource for this object. |
java.lang.String |
getType()
Returns the type of this object. |
int |
hashCode()
Returns the hash code of the name. |
boolean |
isEditable()
Returns true if this object can be modified. |
ITypedElement |
replace(ITypedElement child,
ITypedElement other)
This method is called on a parent to add or remove a child, or to copy the contents of a child. |
| Methods inherited from class org.eclipse.compare.BufferedContent |
addContentChangeListener, discardBuffer, fireContentChanged, getContent, removeContentChangeListener, setContent |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.compare.IEditableContent |
setContent |
| Field Detail |
fResource
private org.eclipse.core.resources.IResource fResource
fChildren
private java.util.ArrayList fChildren
| Constructor Detail |
ResourceNode
public ResourceNode(org.eclipse.core.resources.IResource resource)
- Creates a
ResourceNodefor the given resource.
| Method Detail |
getResource
public org.eclipse.core.resources.IResource getResource()
- Returns the corresponding resource for this object.
getContents
public java.io.InputStream getContents() throws org.eclipse.core.runtime.CoreException
- Description copied from interface:
IStreamContentAccessor - Returns an open
InputStreamfor 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- Overrides:
getContentsin classBufferedContent
getModificationDate
public long getModificationDate()
- Description copied from interface:
IModificationDate - Returns the modification time of this object.
Note that this value should only be used to give the user a general idea of how old the object is.
- Specified by:
getModificationDatein interfaceIModificationDate
getName
public java.lang.String getName()
- Description copied from interface:
ITypedElement - Returns the name of this object.
The name is used when displaying this object in the UI.
- Specified by:
getNamein interfaceITypedElement
getType
public java.lang.String getType()
- Description copied from interface:
ITypedElement - Returns the type of this object. For objects with a file name
this is typically the file extension. For folders its the constant
FOLDER_TYPE. The type is used for determining a suitable viewer for this object.- Specified by:
getTypein interfaceITypedElement
getImage
public org.eclipse.swt.graphics.Image getImage()
- Description copied from interface:
ITypedElement - Returns an image for this object.
This image is used when displaying this object in the UI.
- Specified by:
getImagein interfaceITypedElement
equals
public boolean equals(java.lang.Object other)
- Returns
trueif the other object is of typeITypedElementand their names are identical. The content is not considered.- Specified by:
equalsin interfaceorg.eclipse.compare.structuremergeviewer.IStructureComparator
hashCode
public int hashCode()
- Returns the hash code of the name.
getChildren
public java.lang.Object[] getChildren()
- Description copied from interface:
org.eclipse.compare.structuremergeviewer.IStructureComparator - Returns an iterator for all children of this object or
nullif there are no children.- Specified by:
getChildrenin interfaceorg.eclipse.compare.structuremergeviewer.IStructureComparator
createChild
protected org.eclipse.compare.structuremergeviewer.IStructureComparator createChild(org.eclipse.core.resources.IResource child)
- This hook method is called from
getChildrenonce for every member of a container resource. This implementation creates a newResourceNodefor the given child resource. Clients may override this method to create a different type ofIStructureComparatoror to filter children by returningnull.
createStream
protected java.io.InputStream createStream() throws org.eclipse.core.runtime.CoreException
- Returns an open stream if the corresponding resource implements the
IStorageinterface. Otherwise the valuenullis returned.- Specified by:
createStreamin classBufferedContent
isEditable
public boolean isEditable()
- Description copied from interface:
IEditableContent - Returns
trueif this object can be modified. If it returnsfalsethe other methods of this API must not be called.- Specified by:
isEditablein interfaceIEditableContent
replace
public ITypedElement replace(ITypedElement child, ITypedElement other)
- Description copied from interface:
IEditableContent - This method is called on a parent to add or remove a child,
or to copy the contents of a child.
What to do is encoded in the two arguments as follows:
add: child == null other != null remove: child != null other == null copy: child != null other != null - Specified by:
replacein interfaceIEditableContent
getCharset
public java.lang.String getCharset()
- Description copied from interface:
IEncodedStreamContentAccessor - Returns the name of a charset encoding to be used when decoding this
stream accessor's contents into characters. Returns
nullif a proper encoding cannot be determined.Note: this method does not check whether the result is a supported charset name. Callers should be prepared to handle
UnsupportedEncodingExceptionwhere this charset is used.- Specified by:
getCharsetin interfaceIEncodedStreamContentAccessor
|
|||||||||
| Home >> All >> org >> eclipse >> [ compare overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC