org.eclipse.jdt.internal.core
Class JavaElementDelta

java.lang.Object
  extended by org.eclipse.jdt.internal.core.SimpleDelta
      extended by org.eclipse.jdt.internal.core.JavaElementDelta
All Implemented Interfaces:
IJavaElementDelta

public class JavaElementDelta
extends SimpleDelta
implements IJavaElementDelta

See Also:
IJavaElementDelta

Field Summary
 
Fields inherited from interface 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
JavaElementDelta(IJavaElement element)
          Creates the root delta.
 
Method Summary
 void added(IJavaElement element)
          Creates the nested deltas resulting from an add operation.
 void added(IJavaElement element, int flags)
           
 JavaElementDelta changed(IJavaElement element, int changeFlag)
          Creates the nested deltas resulting from a change operation.
 void changedAST(CompilationUnit changedAST)
           
 void closed(IJavaElement element)
          Creates the nested deltas for a closed element.
 void contentChanged()
          Mark this delta as a content changed 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.
 CompilationUnit getCompilationUnitAST()
          Returns the compilation unit AST created by the last reconcile operation on this delta's 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.
 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.
 void removed(IJavaElement element)
          Creates the nested deltas resulting from an delete operation.
 void removed(IJavaElement element, int flags)
           
 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.
 java.lang.String toString()
          Returns a string representation of this delta's structure suitable for debug purposes.
 
Methods inherited from class org.eclipse.jdt.internal.core.SimpleDelta
added, changed, getFlags, getKind, modifiers, removed, superTypes
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.jdt.core.IJavaElementDelta
getFlags, getKind
 

Constructor Detail

JavaElementDelta

public JavaElementDelta(IJavaElement element)
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...).

Method Detail

added

public void added(IJavaElement element)
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

public void added(IJavaElement element,
                  int flags)

changed

public JavaElementDelta changed(IJavaElement element,
                                int changeFlag)
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

public void changedAST(CompilationUnit changedAST)

contentChanged

public void contentChanged()
Mark this delta as a content changed delta.


closed

public void closed(IJavaElement element)
Creates the nested deltas for a closed element.


fineGrained

public void fineGrained()
Mark this delta as a fine-grained delta.


getAddedChildren

public IJavaElementDelta[] getAddedChildren()
Description copied from interface: IJavaElementDelta
Returns deltas for the children that have been added.

Specified by:
getAddedChildren in interface IJavaElementDelta
Returns:
deltas for the children that have been added
See Also:
IJavaElementDelta

getAffectedChildren

public IJavaElementDelta[] getAffectedChildren()
Description copied from interface: IJavaElementDelta
Returns deltas for the affected (added, removed, or changed) children.

Specified by:
getAffectedChildren in interface IJavaElementDelta
Returns:
deltas for the affected (added, removed, or changed) children
See Also:
IJavaElementDelta

getCompilationUnitAST

public CompilationUnit 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:

Specified by:
getCompilationUnitAST in interface IJavaElementDelta
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

public IJavaElementDelta[] 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 an IAnnotatable.

Specified by:
getAnnotationDeltas in interface IJavaElementDelta
Returns:
deltas for affected annotations (added, removed, or changed)

getChangedChildren

public IJavaElementDelta[] getChangedChildren()
Description copied from interface: IJavaElementDelta
Returns deltas for the children which have changed.

Specified by:
getChangedChildren in interface IJavaElementDelta
Returns:
deltas for the children which have changed
See Also:
IJavaElementDelta

getElement

public IJavaElement getElement()
Description copied from interface: IJavaElementDelta
Returns the element that this delta describes a change to.

Specified by:
getElement in interface IJavaElementDelta
Returns:
the element that this delta describes a change to
See Also:
IJavaElementDelta

getMovedFromElement

public IJavaElement getMovedFromElement()
Description copied from interface: IJavaElementDelta
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.

Specified by:
getMovedFromElement in interface IJavaElementDelta
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
See Also:
IJavaElementDelta

getMovedToElement

public IJavaElement getMovedToElement()
Description copied from interface: IJavaElementDelta
Returns an element describing this element in its new location, or null if the IJavaElementDelta.F_MOVED_TO change flag is not set.

Specified by:
getMovedToElement in interface IJavaElementDelta
Returns:
an element describing this element in its new location, or null if the IJavaElementDelta.F_MOVED_TO change flag is not set
See Also:
IJavaElementDelta

getRemovedChildren

public IJavaElementDelta[] getRemovedChildren()
Description copied from interface: IJavaElementDelta
Returns deltas for the children which have been removed.

Specified by:
getRemovedChildren in interface IJavaElementDelta
Returns:
deltas for the children which have been removed
See Also:
IJavaElementDelta

getResourceDeltas

public IResourceDelta[] getResourceDeltas()
Return the collection of resource deltas. Return null if none.

Specified by:
getResourceDeltas in interface IJavaElementDelta
Returns:
the underlying resource deltas, or null if none

movedFrom

public void movedFrom(IJavaElement movedFromElement,
                      IJavaElement movedToElement)
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

public void movedTo(IJavaElement movedToElement,
                    IJavaElement movedFromElement)
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

public void opened(IJavaElement element)
Creates the nested deltas for an opened element.


removed

public void removed(IJavaElement element)
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

public void removed(IJavaElement element,
                    int flags)

sourceAttached

public void sourceAttached(IJavaElement element)
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

public void sourceDetached(IJavaElement element)
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

public java.lang.String toDebugString(int depth)
Returns a string representation of this delta's structure suitable for debug purposes.

See Also:
toString()

toString

public java.lang.String toString()
Returns a string representation of this delta's structure suitable for debug purposes.

Overrides:
toString in class SimpleDelta