Class DiffContainer
java.lang.Object
org.eclipse.compare.structuremergeviewer.DiffElement
org.eclipse.compare.structuremergeviewer.DiffContainer
- All Implemented Interfaces:
- ITypedElement,- IDiffContainer,- IDiffElement
- Direct Known Subclasses:
- DiffNode
The standard implementation of a diff container element.
 
This class may be instantiated, or further subclassed.
- 
Field SummaryFields inherited from interface org.eclipse.compare.ITypedElementFOLDER_TYPE, TEXT_TYPE, UNKNOWN_TYPE
- 
Constructor SummaryConstructorsConstructorDescriptionDiffContainer(IDiffContainer parent, int kind) Creates a new container with the specified kind under the given parent.
- 
Method SummaryModifier and TypeMethodDescriptionvoidadd(IDiffElement diff) Adds the given child to this container.Tries to find the child with the given name.Returns the children of this container.booleanReturns whether this container has at least one child.voidremove(IDiffElement child) Removes the given child (non-recursively) from this container.voidremoveToRoot(IDiffElement child) Removes the given child from this container.Methods inherited from class org.eclipse.compare.structuremergeviewer.DiffElementgetImage, getKind, getParent, getType, setKind, setParentMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.compare.structuremergeviewer.IDiffElementgetKind, getParent, setParentMethods inherited from interface org.eclipse.compare.ITypedElementgetImage, getName, getType
- 
Constructor Details- 
DiffContainerCreates a new container with the specified kind under the given parent.- Parameters:
- parent- under which the new container is added as a child or- null.
- kind- of difference (defined in- Differencer).
 
 
- 
- 
Method Details- 
findChildTries to find the child with the given name. Returnsnullif no such child exists.- Parameters:
- name- of the child to find
- Returns:
- the first element with a matching name
 
- 
addDescription copied from interface:IDiffContainerAdds the given child to this container. If the child is already contained in this container, this method has no effect.- Specified by:
- addin interface- IDiffContainer
- Parameters:
- diff- the child to be added to this container
 
- 
removeToRootDescription copied from interface:IDiffContainerRemoves the given child from this container. If the container becomes empty it is removed from its container. If the child is not contained in this container, this method has no effect.- Specified by:
- removeToRootin interface- IDiffContainer
- Parameters:
- child- the child to be removed from this container
 
- 
removeRemoves the given child (non-recursively) from this container.- Parameters:
- child- to remove
 
- 
hasChildrenpublic boolean hasChildren()Description copied from interface:IDiffContainerReturns whether this container has at least one child. In some cases this methods avoids having to call the potential more costlygetChildrenmethod.- Specified by:
- hasChildrenin interface- IDiffContainer
- Returns:
- trueif this container has at least one child
 
- 
getChildrenDescription copied from interface:IDiffContainerReturns the children of this container. If this container has no children an empty array is returned (notnull).- Specified by:
- getChildrenin interface- IDiffContainer
- Returns:
- the children of this container as an array
 
 
-