public class JavaElementDelta extends SimpleDelta implements IJavaElementDelta
IJavaElementDelta| Modifier and Type | Class and Description |
|---|---|
protected static class |
JavaElementDelta.Key
The delta key
|
| Modifier and Type | Field and Description |
|---|---|
boolean |
ignoreFromTests |
changeFlags, kindADDED, CHANGED, F_ADDED_TO_CLASSPATH, F_ANNOTATIONS, F_ARCHIVE_CONTENT_CHANGED, F_AST_AFFECTED, F_CATEGORIES, F_CHILDREN, F_CLASSPATH_CHANGED, F_CLASSPATH_REORDER, F_CLOSED, F_CONTENT, F_FINE_GRAINED, F_MODIFIERS, F_MOVED_FROM, F_MOVED_TO, F_OPENED, F_PRIMARY_RESOURCE, F_PRIMARY_WORKING_COPY, F_REMOVED_FROM_CLASSPATH, F_REORDER, F_RESOLVED_CLASSPATH_CHANGED, F_SOURCEATTACHED, F_SOURCEDETACHED, F_SUPER_TYPES, REMOVED| Constructor and Description |
|---|
JavaElementDelta(IJavaElement element)
Creates the root delta.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAffectedChild(JavaElementDelta child)
Adds the child delta to the collection of affected children.
|
void |
added(IJavaElement element)
Creates the nested deltas resulting from an add operation.
|
void |
added(IJavaElement element,
int flags) |
protected void |
addNewChild(JavaElementDelta child)
Adds the new child delta to the collection of affected children.
|
protected void |
addResourceDelta(IResourceDelta child)
Adds the child delta to the collection of affected children.
|
JavaElementDelta |
changed(IJavaElement element,
int changeFlag)
Creates the nested deltas resulting from a change operation.
|
void |
changedAST(CompilationUnit changedAST) |
protected void |
clearAffectedChildren()
Clears the collection of affected children.
|
void |
closed(IJavaElement element)
Creates the nested deltas for a closed element.
|
void |
contentChanged()
Mark this delta as a content changed delta.
|
protected JavaElementDelta |
createDeltaTree(IJavaElement element,
JavaElementDelta delta)
Creates the nested delta deltas based on the affected element
its delta, and the root of this delta tree.
|
protected static boolean |
equalsAndSameParent(IJavaElement e1,
IJavaElement e2)
Returns whether the two java elements are equals and have the same parent.
|
protected JavaElementDelta |
find(IJavaElement e)
Returns the
JavaElementDelta for the given element
in the delta tree, or null, if no delta for the given element is found. |
protected JavaElementDelta |
findDescendant(JavaElementDelta.Key key)
Returns the descendant delta for the given key, or
null,
if no delta for the given key is found in the delta tree below this delta. |
void |
fineGrained()
Mark this delta as a fine-grained delta.
|
IJavaElementDelta[] |
getAddedChildren()
Returns deltas for the children that have been added.
|
IJavaElementDelta[] |
getAffectedChildren()
Returns deltas for the affected (added, removed, or changed) children.
|
IJavaElementDelta[] |
getAnnotationDeltas()
Returns deltas for affected annotations (added, removed, or changed).
|
IJavaElementDelta[] |
getChangedChildren()
Returns deltas for the children which have changed.
|
protected java.lang.Integer |
getChildIndex(JavaElementDelta.Key key)
Returns the index of the delta in the collection of affected children,
or
null if the child delta for the given key is not found. |
protected IJavaElementDelta[] |
getChildrenOfType(int type) |
CompilationUnit |
getCompilationUnitAST()
Returns the compilation unit AST created by the last reconcile operation on this delta's element.
|
protected JavaElementDelta |
getDeltaFor(IJavaElement element)
Returns the delta for a given element.
|
IJavaElement |
getElement()
Returns the element that this delta describes a change to.
|
IJavaElement |
getMovedFromElement()
Returns an element describing this element before it was moved
to its current location, or
null if the
IJavaElementDelta.F_MOVED_FROM change flag is not set. |
IJavaElement |
getMovedToElement()
Returns an element describing this element in its new location,
or
null if the IJavaElementDelta.F_MOVED_TO change
flag is not set. |
IJavaElementDelta[] |
getRemovedChildren()
Returns deltas for the children which have been removed.
|
IResourceDelta[] |
getResourceDeltas()
Return the collection of resource deltas.
|
protected IJavaElementDelta[] |
growAndAddToArray(IJavaElementDelta[] array,
IJavaElementDelta addition)
Adds the new element to a new array that contains all of the elements of the old array.
|
protected void |
insertDeltaTree(IJavaElement element,
JavaElementDelta delta)
Creates the delta tree for the given element and delta, and then
inserts the tree as an affected child of this node.
|
void |
movedFrom(IJavaElement movedFromElement,
IJavaElement movedToElement)
Creates the nested deltas resulting from an move operation.
|
void |
movedTo(IJavaElement movedToElement,
IJavaElement movedFromElement)
Creates the nested deltas resulting from an move operation.
|
void |
opened(IJavaElement element)
Creates the nested deltas for an opened element.
|
protected void |
removeAffectedChild(JavaElementDelta child)
Removes the child delta from the collection of affected children.
|
protected IJavaElementDelta[] |
removeAndShrinkArray(IJavaElementDelta[] old,
int index)
Removes the element from the array.
|
void |
removed(IJavaElement element)
Creates the nested deltas resulting from an delete operation.
|
void |
removed(IJavaElement element,
int flags) |
protected void |
removeExistingChild(JavaElementDelta.Key key,
int index)
Removes the existing child delta from the collection of affected children.
|
void |
sourceAttached(IJavaElement element)
Creates the nested deltas resulting from a change operation.
|
void |
sourceDetached(IJavaElement element)
Creates the nested deltas resulting from a change operation.
|
java.lang.String |
toDebugString(int depth)
Returns a string representation of this delta's
structure suitable for debug purposes.
|
protected boolean |
toDebugString(java.lang.StringBuffer buffer,
int flags) |
java.lang.String |
toString()
Returns a string representation of this delta's
structure suitable for debug purposes.
|
added, changed, getFlags, getKind, modifiers, removed, superTypes, toDebugStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFlags, getKindpublic JavaElementDelta(IJavaElement element)
added(IJavaElement)
changed(IJavaElement)
moved(IJavaElement, IJavaElement)
removed(IJavaElement)
renamed(IJavaElement, IJavaElement)
protected void addAffectedChild(JavaElementDelta child)
public void added(IJavaElement element)
public void added(IJavaElement element, int flags)
protected void addNewChild(JavaElementDelta child)
protected void addResourceDelta(IResourceDelta child)
public JavaElementDelta changed(IJavaElement element, int changeFlag)
public void changedAST(CompilationUnit changedAST)
protected void clearAffectedChildren()
public void contentChanged()
public void closed(IJavaElement element)
protected JavaElementDelta createDeltaTree(IJavaElement element, JavaElementDelta delta)
protected static boolean equalsAndSameParent(IJavaElement e1, IJavaElement e2)
protected JavaElementDelta find(IJavaElement e)
JavaElementDelta for the given element
in the delta tree, or null, if no delta for the given element is found.protected JavaElementDelta findDescendant(JavaElementDelta.Key key)
null,
if no delta for the given key is found in the delta tree below this delta.public void fineGrained()
public IJavaElementDelta[] getAddedChildren()
IJavaElementDeltagetAddedChildren in interface IJavaElementDeltaIJavaElementDeltapublic IJavaElementDelta[] getAffectedChildren()
IJavaElementDeltagetAffectedChildren in interface IJavaElementDeltaIJavaElementDeltapublic CompilationUnit getCompilationUnitAST()
IJavaElementDeltaICompilationUnit in working copy modeElementChangedEvent.POST_RECONCILE event
getCompilationUnitAST in interface IJavaElementDeltaICompilationUnit#reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor),
IJavaElementDelta.F_AST_AFFECTEDpublic IJavaElementDelta[] getAnnotationDeltas()
IJavaElementDeltaIAnnotatable.getAnnotationDeltas in interface IJavaElementDeltapublic IJavaElementDelta[] getChangedChildren()
IJavaElementDeltagetChangedChildren in interface IJavaElementDeltaIJavaElementDeltaprotected java.lang.Integer getChildIndex(JavaElementDelta.Key key)
null if the child delta for the given key is not found.protected IJavaElementDelta[] getChildrenOfType(int type)
IJavaElementDeltaprotected JavaElementDelta getDeltaFor(IJavaElement element)
public IJavaElement getElement()
IJavaElementDeltagetElement in interface IJavaElementDeltaIJavaElementDeltapublic IJavaElement getMovedFromElement()
IJavaElementDeltanull if the
IJavaElementDelta.F_MOVED_FROM change flag is not set.getMovedFromElement in interface IJavaElementDeltanull if the
IJavaElementDelta.F_MOVED_FROM change flag is not setIJavaElementDeltapublic IJavaElement getMovedToElement()
IJavaElementDeltanull if the IJavaElementDelta.F_MOVED_TO change
flag is not set.getMovedToElement in interface IJavaElementDeltanull if the IJavaElementDelta.F_MOVED_TO change
flag is not setIJavaElementDeltapublic IJavaElementDelta[] getRemovedChildren()
IJavaElementDeltagetRemovedChildren in interface IJavaElementDeltaIJavaElementDeltapublic IResourceDelta[] getResourceDeltas()
getResourceDeltas in interface IJavaElementDeltanull if noneprotected IJavaElementDelta[] growAndAddToArray(IJavaElementDelta[] array, IJavaElementDelta addition)
protected void insertDeltaTree(IJavaElement element, JavaElementDelta delta)
public void movedFrom(IJavaElement movedFromElement, IJavaElement movedToElement)
public void movedTo(IJavaElement movedToElement, IJavaElement movedFromElement)
public void opened(IJavaElement element)
protected void removeAffectedChild(JavaElementDelta child)
protected IJavaElementDelta[] removeAndShrinkArray(IJavaElementDelta[] old, int index)
public void removed(IJavaElement element)
public void removed(IJavaElement element, int flags)
protected void removeExistingChild(JavaElementDelta.Key key, int index)
public void sourceAttached(IJavaElement element)
public void sourceDetached(IJavaElement element)
public java.lang.String toDebugString(int depth)
toString()protected boolean toDebugString(java.lang.StringBuffer buffer,
int flags)
toDebugString in class SimpleDeltapublic java.lang.String toString()
toString in class SimpleDelta