Class SyncInfoTree
java.lang.Object
org.eclipse.team.core.synchronize.SyncInfoSet
org.eclipse.team.core.synchronize.SyncInfoTree
Provides addition API for accessing the
SyncInfo in the set through
their resource's hierarchical relationships.
Events fired from a SyncInfoTree will be instances of ISyncInfoTreeChangeEvent.
- Since:
- 3.0
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty sync info tree.SyncInfoTree(SyncInfo[] infos) Create a sync info tree containing the given sync info elements. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd the givenSyncInfoto the set.voidclear()Reset the sync set so it is empty.protected SyncInfoSetChangeEventCreate an empty change event.SyncInfo[]getSyncInfos(IResource resource, int depth) Return theSyncInfofor each out-of-sync resource in the subtree rooted at the given resource to the depth specified.booleanhasMembers(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.Return the immediate children of the given resource who are either out-of-sync or contain out-of-sync resources.voidRemove the given local resource from the set.voidRemove from this set theSyncInfofor the given resource and any of its descendants within the specified depth.Methods inherited from class org.eclipse.team.core.synchronize.SyncInfoSet
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, size
-
Field Details
-
parents
-
-
Constructor Details
-
SyncInfoTree
public SyncInfoTree()Create an empty sync info tree. -
SyncInfoTree
Create a sync info tree containing the given sync info elements.- Parameters:
infos- the sync info elements
-
-
Method Details
-
hasMembers
Return whether the given resource has any children in the sync set. The children could be either out-of-sync resources that are contained by the set or containers that are ancestors of out-of-sync resources contained by the set.- Parameters:
resource- the resource to check for children.- Returns:
trueif the resource has children in the set.
-
getSyncInfos
Return theSyncInfofor 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)andgetSyncInfos()to provide the varying depths. Subclasses may override to optimize.- Parameters:
resource- the root of the resource subtreedepth- the depth of the subtree- Returns:
- the
SyncInfofor any out-of-sync resources
-
createEmptyChangeEvent
Description copied from class:SyncInfoSetCreate an empty change event. Subclass may override to provided specialized event types- Overrides:
createEmptyChangeEventin classSyncInfoSet- Returns:
- an empty change event
-
add
Description copied from class:SyncInfoSetAdd the givenSyncInfoto the set. A change event will be generated unless the call to this method is nested in between calls tobeginInput()andendInput(IProgressMonitor)in which case the event for this addition and any other sync set change will be fired in a batched event whenendInputis 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 withinbeginInput/endInput.- Overrides:
addin classSyncInfoSet- Parameters:
info- the sync info to be added to this set.
-
remove
Description copied from class:SyncInfoSetRemove the given local resource from the set.- Overrides:
removein classSyncInfoSet- Parameters:
resource- the local resource to remove
-
clear
public void clear()Description copied from class:SyncInfoSetReset the sync set so it is empty. Listeners are notified of the change.- Overrides:
clearin classSyncInfoSet
-
remove
Remove from this set theSyncInfofor 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.
- Parameters:
resource- the root of the resource subtreedepth- the depth of the subtree
-
internalGetOutOfSyncDescendants
This is an internal method and is not intended to be invoked or overridden by clients. -
members
Return the immediate children of the given resource who are either out-of-sync or contain out-of-sync resources.- Parameters:
resource- the parent resource- Returns:
- the children of the resource that are either out-of-sync or are ancestors of out-of-sync resources contained in the set
-