Class JavaElementDelta
java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
org.aspectj.org.eclipse.jdt.internal.core.JavaElementDelta
- All Implemented Interfaces:
IJavaElementDelta
- See Also:
IJavaElementDelta
-
Nested Class Summary
-
Field Summary
Fields inherited from class org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
changeFlags, kind
Fields inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElementDelta
ADDED, 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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(org.eclipse.core.resources.IResourceDelta child)
Adds the child delta to the collection of affected children.changed(IJavaElement element, int changeFlag)
Creates the nested deltas resulting from a change operation.void
changedAST(CompilationUnit changedAST)
protected void
Clears the collection of affected children.void
closed(IJavaElement element)
Creates the nested deltas for a closed element.void
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 theJavaElementDelta
for the given element in the delta tree, or null, if no delta for the given element is found.protected JavaElementDelta
Returns the descendant delta for the given key, ornull
, if no delta for the given key is found in the delta tree below this delta.void
Mark this delta as a fine-grained delta.Returns deltas for the children that have been added.Returns deltas for the affected (added, removed, or changed) children.Returns deltas for affected annotations (added, removed, or changed).Returns deltas for the children which have changed.protected Integer
Returns the index of the delta in the collection of affected children, ornull
if the child delta for the given key is not found.protected IJavaElementDelta[]
getChildrenOfType(int type)
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.Returns the element that this delta describes a change to.Returns an element describing this element before it was moved to its current location, ornull
if theIJavaElementDelta.F_MOVED_FROM
change flag is not set.Returns an element describing this element in its new location, ornull
if theIJavaElementDelta.F_MOVED_TO
change flag is not set.Returns deltas for the children which have been removed.org.eclipse.core.resources.IResourceDelta[]
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.toDebugString(int depth)
Returns a string representation of this delta's structure suitable for debug purposes.protected boolean
toDebugString(StringBuffer buffer, int flags)
toString()
Returns a string representation of this delta's structure suitable for debug purposes.Methods inherited from class org.aspectj.org.eclipse.jdt.internal.core.SimpleDelta
added, changed, getFlags, getKind, modifiers, removed, superTypes, toDebugString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.aspectj.org.eclipse.jdt.core.IJavaElementDelta
getFlags, getKind
-
Field Details
-
ignoreFromTests
public boolean ignoreFromTests
-
-
Constructor Details
-
JavaElementDelta
Creates the root delta. To create the nested delta hierarchies use the following convenience methods. The root delta can be created at any level (for example: project, package root, package fragment...).added(IJavaElement)
changed(IJavaElement)
moved(IJavaElement, IJavaElement)
removed(IJavaElement)
renamed(IJavaElement, IJavaElement)
-
-
Method Details
-
addAffectedChild
Adds the child delta to the collection of affected children. If the child is already in the collection, walk down the hierarchy. -
added
Creates the nested deltas resulting from an add operation. Convenience method for creating add deltas. The constructor should be used to create the root delta and then an add operation should call this method. -
added
-
addNewChild
Adds the new child delta to the collection of affected children. -
addResourceDelta
protected void addResourceDelta(org.eclipse.core.resources.IResourceDelta child)Adds the child delta to the collection of affected children. If the child is already in the collection, walk down the hierarchy. -
changed
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
changedAST
-
clearAffectedChildren
protected void clearAffectedChildren()Clears the collection of affected children. -
contentChanged
public void contentChanged()Mark this delta as a content changed delta. -
closed
Creates the nested deltas for a closed element. -
createDeltaTree
Creates the nested delta deltas based on the affected element its delta, and the root of this delta tree. Returns the root of the created delta tree. -
equalsAndSameParent
Returns whether the two java elements are equals and have the same parent. -
find
Returns theJavaElementDelta
for the given element in the delta tree, or null, if no delta for the given element is found. -
findDescendant
Returns the descendant delta for the given key, ornull
, if no delta for the given key is found in the delta tree below this delta. -
fineGrained
public void fineGrained()Mark this delta as a fine-grained delta. -
getAddedChildren
Description copied from interface:IJavaElementDelta
Returns deltas for the children that have been added.- Specified by:
getAddedChildren
in interfaceIJavaElementDelta
- Returns:
- deltas for the children that have been added
- See Also:
IJavaElementDelta
-
getAffectedChildren
Description copied from interface:IJavaElementDelta
Returns deltas for the affected (added, removed, or changed) children.- Specified by:
getAffectedChildren
in interfaceIJavaElementDelta
- Returns:
- deltas for the affected (added, removed, or changed) children
- See Also:
IJavaElementDelta
-
getCompilationUnitAST
Description copied from interface:IJavaElementDelta
Returns the compilation unit AST created by the last reconcile operation on this delta's element. This returns a non-null value if and only if:- the last reconcile operation on this working copy requested an AST
- this delta's element is an
ICompilationUnit
in working copy mode - the delta comes from a
ElementChangedEvent.POST_RECONCILE
event
- Specified by:
getCompilationUnitAST
in interfaceIJavaElementDelta
- Returns:
- the AST created during the last reconcile operation
- See Also:
ICompilationUnit.reconcile(int, boolean, WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor)
,IJavaElementDelta.F_AST_AFFECTED
-
getAnnotationDeltas
Description copied from interface:IJavaElementDelta
Returns deltas for affected annotations (added, removed, or changed). Returns an empty array if no annotations was affected, or if this delta's element is not anIAnnotatable
.- Specified by:
getAnnotationDeltas
in interfaceIJavaElementDelta
- Returns:
- deltas for affected annotations (added, removed, or changed)
-
getChangedChildren
Description copied from interface:IJavaElementDelta
Returns deltas for the children which have changed.- Specified by:
getChangedChildren
in interfaceIJavaElementDelta
- Returns:
- deltas for the children which have changed
- See Also:
IJavaElementDelta
-
getChildIndex
Returns the index of the delta in the collection of affected children, ornull
if the child delta for the given key is not found. -
getChildrenOfType
- See Also:
IJavaElementDelta
-
getDeltaFor
Returns the delta for a given element. Only looks below this delta. -
getElement
Description copied from interface:IJavaElementDelta
Returns the element that this delta describes a change to.- Specified by:
getElement
in interfaceIJavaElementDelta
- Returns:
- the element that this delta describes a change to
- See Also:
IJavaElementDelta
-
getMovedFromElement
Description copied from interface:IJavaElementDelta
Returns an element describing this element before it was moved to its current location, ornull
if theIJavaElementDelta.F_MOVED_FROM
change flag is not set.- Specified by:
getMovedFromElement
in interfaceIJavaElementDelta
- Returns:
- an element describing this element before it was moved
to its current location, or
null
if theIJavaElementDelta.F_MOVED_FROM
change flag is not set - See Also:
IJavaElementDelta
-
getMovedToElement
Description copied from interface:IJavaElementDelta
Returns an element describing this element in its new location, ornull
if theIJavaElementDelta.F_MOVED_TO
change flag is not set.- Specified by:
getMovedToElement
in interfaceIJavaElementDelta
- Returns:
- an element describing this element in its new location,
or
null
if theIJavaElementDelta.F_MOVED_TO
change flag is not set - See Also:
IJavaElementDelta
-
getRemovedChildren
Description copied from interface:IJavaElementDelta
Returns deltas for the children which have been removed.- Specified by:
getRemovedChildren
in interfaceIJavaElementDelta
- Returns:
- deltas for the children which have been removed
- See Also:
IJavaElementDelta
-
getResourceDeltas
public org.eclipse.core.resources.IResourceDelta[] getResourceDeltas()Return the collection of resource deltas. Return null if none.- Specified by:
getResourceDeltas
in interfaceIJavaElementDelta
- Returns:
- the underlying resource deltas, or
null
if none
-
growAndAddToArray
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. Returns the new array. -
insertDeltaTree
Creates the delta tree for the given element and delta, and then inserts the tree as an affected child of this node. -
movedFrom
Creates the nested deltas resulting from an move operation. Convenience method for creating the "move from" delta. The constructor should be used to create the root delta and then the move operation should call this method. -
movedTo
Creates the nested deltas resulting from an move operation. Convenience method for creating the "move to" delta. The constructor should be used to create the root delta and then the move operation should call this method. -
opened
Creates the nested deltas for an opened element. -
removeAffectedChild
Removes the child delta from the collection of affected children. -
removeAndShrinkArray
Removes the element from the array. Returns the a new array which has shrunk. -
removed
Creates the nested deltas resulting from an delete operation. Convenience method for creating removed deltas. The constructor should be used to create the root delta and then the delete operation should call this method. -
removed
-
removeExistingChild
Removes the existing child delta from the collection of affected children. -
sourceAttached
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
sourceDetached
Creates the nested deltas resulting from a change operation. Convenience method for creating change deltas. The constructor should be used to create the root delta and then a change operation should call this method. -
toDebugString
Returns a string representation of this delta's structure suitable for debug purposes.- See Also:
toString()
-
toDebugString
- Overrides:
toDebugString
in classSimpleDelta
-
toString
Returns a string representation of this delta's structure suitable for debug purposes.- Overrides:
toString
in classSimpleDelta
-