public class SyncInfoTree extends SyncInfoSet
SyncInfo in the set through
their resource's hierarchical relationships.
Events fired from a SyncInfoTree will be instances of ISyncInfoTreeChangeEvent.
SyncInfoSet| Constructor and Description |
|---|
SyncInfoTree()
Create an empty sync info tree.
|
SyncInfoTree(SyncInfo[] infos)
Create a sync info tree containing the given sync info elements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(SyncInfo info)
Add the given
SyncInfo to the set. |
void |
clear()
Reset the sync set so it is empty.
|
protected org.eclipse.team.internal.core.subscribers.SyncSetChangedEvent |
createEmptyChangeEvent()
Overrides inherited method to provide an instance of
ISyncInfoTreeChangeEvent. |
SyncInfo[] |
getSyncInfos(IResource resource,
int depth)
Return the
SyncInfo for each out-of-sync resource in the subtree rooted at the given resource
to the depth specified. |
boolean |
hasMembers(IResource resource)
Return whether the given resource has any children in the sync set.
|
protected IResource[] |
internalGetOutOfSyncDescendants(IContainer resource)
This is an internal method and is not intended to be invoked or
overridden by clients.
|
IResource[] |
members(IResource resource)
Return the immediate children of the given resource who are either out-of-sync
or contain out-of-sync resources.
|
void |
remove(IResource resource)
Remove the given local resource from the set.
|
void |
remove(IResource resource,
int depth)
Remove from this set the
SyncInfo for the given resource and any of its descendants
within the specified depth. |
addAll, addError, addSyncSetChangedListener, beginInput, connect, countFor, endInput, getChangeEvent, getErrors, getListeners, getNodes, getResources, getSyncInfo, getSyncInfos, hasConflicts, hasIncomingChanges, hasNodes, hasOutgoingChanges, internalAdd, internalRemove, isEmpty, iterator, rejectNodes, removeAll, removeConflictingNodes, removeIncomingNodes, removeOutgoingNodes, removeSyncSetChangedListener, resetChanges, selectNodes, sizeprotected Map parents
public SyncInfoTree()
public SyncInfoTree(SyncInfo[] infos)
infos - the sync info elementspublic boolean hasMembers(IResource resource)
resource - the resource to check for children.true if the resource has children in the set.public SyncInfo[] getSyncInfos(IResource resource, int depth)
SyncInfo for each out-of-sync resource in the subtree rooted at the given resource
to the depth specified. The depth is one of:
IResource.DEPTH_ZERO: the resource only,
IResource.DEPTH_ONE: the resource or its direct children,
IResource.DEPTH_INFINITE: the resource and all of it's descendants.
The default implementation makes use of getSyncInfo(IResource),
members(IResource) and getSyncInfos()
to provide the varying depths. Subclasses may override to optimize.
resource - the root of the resource subtreedepth - the depth of the subtreeSyncInfo for any out-of-sync resourcesprotected org.eclipse.team.internal.core.subscribers.SyncSetChangedEvent createEmptyChangeEvent()
ISyncInfoTreeChangeEvent.createEmptyChangeEvent in class SyncInfoSetpublic void add(SyncInfo info)
SyncInfoSetSyncInfo to the set. A change event will
be generated unless the call to this method is nested in between calls
to beginInput() and endInput(IProgressMonitor)
in which case the event for this addition and any other sync set
change will be fired in a batched event when endInput
is invoked.
Invoking this method outside of the above mentioned block will result
in the endInput(IProgressMonitor) being invoked with a null
progress monitor. If responsiveness is required, the client should always
nest sync set modifications within beginInput/endInput.
add in class SyncInfoSetinfo - the sync info to be added to this set.public void remove(IResource resource)
SyncInfoSetremove in class SyncInfoSetresource - the local resource to removepublic void clear()
SyncInfoSetclear in class SyncInfoSetpublic void remove(IResource resource, int depth)
SyncInfo for the given resource and any of its descendants
within the specified depth. The depth is one of:
IResource.DEPTH_ZERO: the resource only,
IResource.DEPTH_ONE: the resource or its direct children,
IResource.DEPTH_INFINITE: the resource and all of it's descendants.
resource - the root of the resource subtreedepth - the depth of the subtreeprotected IResource[] internalGetOutOfSyncDescendants(IContainer resource)
public IResource[] members(IResource resource)
resource - the parent resourceGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.