public interface IElementDeltaImpl extends IElementDelta
IElementDelta
s must implement this interface.Modifier and Type | Method and Description |
---|---|
default IElementDelta |
findDelta_(IElement element)
Finds and returns the delta for the given element in this delta subtree
(subtree root included), or
null if no such delta can be
found. |
IElementDelta[] |
getAddedChildren_()
Returns element deltas for the immediate children that have been added.
|
IElementDelta[] |
getAffectedChildren_()
Returns element deltas for all affected (added, removed, or changed)
immediate children.
|
IElementDelta[] |
getChangedChildren_()
Returns element deltas for the immediate children that have been changed.
|
IElement |
getElement_()
Returns the element that this delta describes a change to.
|
long |
getFlags_()
Returns flags which describe in more detail how an element has changed.
|
int |
getKind_()
Returns the kind of this element delta.
|
org.eclipse.core.resources.IMarkerDelta[] |
getMarkerDeltas_()
Returns the changes to markers on the corresponding resource of this
delta's element.
|
IElement |
getMovedFromElement_()
Returns an element describing this delta's element before it was moved
to its current location, or
null if the F_MOVED_FROM change flag is not set. |
IElement |
getMovedToElement_()
Returns an element describing this delta's element in its new location,
or
null if the F_MOVED_TO change flag is not set. |
IElementDelta[] |
getRemovedChildren_()
Returns element deltas for the immediate children that have been removed.
|
org.eclipse.core.resources.IResourceDelta[] |
getResourceDeltas_()
Returns the changes to children of the element's corresponding resource
that cannot be described in terms of element deltas.
|
default boolean |
isEmpty_()
Returns whether this element delta is empty,
i.e., represents an unchanged element.
|
java.lang.String |
toString_(IContext context)
Returns a string representation of this element delta in a form suitable
for debugging purposes.
|
IElement getElement_()
null
)default boolean isEmpty_()
true
if this element delta is empty,
and false
otherwiseint getKind_()
ADDED
,
REMOVED
,
or CHANGED
.
Returns NO_CHANGE
if, and only if, the delta is empty.long getFlags_()
&
operator.
For example:
if ((flags & F_CONTENT) != 0) // a content change
Some change flags make sense for most models and are predefined in
IElementDeltaConstants
, while others are model-specific and are
defined by the model implementor. The range for model-specific change
flags starts from 1L << 32
and includes the upper 32 bits of the
long
value. The lower 32 bits are reserved for predefined
generic change flags.
Move operations are indicated by special change flags. If an element is
moved from A to B (with no other changes to A or B), then A will have
kind REMOVED
, with flag F_MOVED_TO
, and getMovedToElement_()
on A will return the handle for B. B will have
kind ADDED
, with flag F_MOVED_FROM
, and getMovedFromElement_()
on B will return the handle for A. (Note that the
handle for A in this case represents an element that no longer exists.)
default IElementDelta findDelta_(IElement element)
null
if no such delta can be
found.
This is a convenience method to avoid manual traversal of the delta tree in cases where the listener is only interested in changes to particular elements. Calling this method will generally be faster than manually traversing the delta to a particular descendant.
element
- the element of the desired delta (may be null
,
in which case null
will be returned)null
if no such
delta can be foundIElementDelta[] getAffectedChildren_()
null
). Clients must not modify
the returned array.IElementDelta[] getAddedChildren_()
null
). Clients must not modify
the returned array.IElementDelta[] getRemovedChildren_()
null
). Clients must not modify
the returned array.IElementDelta[] getChangedChildren_()
null
). Clients must not modify
the returned array.IElement getMovedFromElement_()
null
if the F_MOVED_FROM
change flag is not set.null
if the F_MOVED_FROM
change flag is not setgetMovedToElement_()
,
getFlags_()
IElement getMovedToElement_()
null
if the F_MOVED_TO
change flag is not set.null
if the F_MOVED_TO
change flag is not setgetMovedFromElement_()
,
getFlags_()
org.eclipse.core.resources.IMarkerDelta[] getMarkerDeltas_()
Returns null
if no markers changed. Note that this is
an exception to the general convention of returning an empty array
rather than null
. This makes the method safe to call
even when org.eclipse.core.resources
bundle is not
available.
Note that marker deltas, like element deltas, are generally only valid for the dynamic scope of change notification. Clients must not hang on to these objects.
null
if none.
Clients must not modify the returned array.org.eclipse.core.resources.IResourceDelta[] getResourceDeltas_()
Returns null
if there were no such changes. Note that this
is an exception to the general convention of returning an empty array
rather than null
. This makes the method safe to call even
when org.eclipse.core.resources
bundle is not available.
Note that resource deltas, like element deltas, are generally only valid for the dynamic scope of change notification. Clients must not hang on to these objects.
null
if none.
Clients must not modify the returned array.java.lang.String toString_(IContext context)
Implementations are encouraged to support common options defined in
ToStringOptions
and
interpret the FORMAT_STYLE
as follows:
context
- not null
null
)Copyright (c) 2014, 2020 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0