Package org.eclipse.team.core.mapping
Interface ISynchronizationScope
public interface ISynchronizationScope
Interface which defines the protocol for translating a set of
ResourceMapping
objects representing a view selection into the
complete set of resources to be operated on.- Since:
- 3.2
- See Also:
- Restriction:
- This interface is not intended to be implemented by clients.
Instead, clients should use a
ISynchronizationScopeManager
to generate a resource mapping scope from a set of input resource mappings.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a scope change listener that will get invoked when a property of the receiver changes.Return a scope that only contains the input mappings of this scope.boolean
Return whether the given resource is contained in this scope.Return the resource mapping context that the scope uses to obtain traversals from resource mappings in order to determine what resources are in the scope.Return the array of mappings that acted as the input to the scope builder that was used to build this scope.getMapping
(Object modelObject) Return the resource mapping in the scope associated with the given model object ornull
if there isn't one.Return an array of all of the mappings to be operated on.getMappings
(String modelProviderId) Return all the mappings to be operated on for the given model provider id.Return all the model providers that have mappings in this scope.IProject[]
Return the projects that bound this scope.getRoots()
Return the resources that are the roots of this scope.Return an array of traversals that cover the resource mappings to be operated on as returned by thegetMappings()
method.getTraversals
(String modelProviderId) Return the set of traversals that cover the mappings for the given model provider.getTraversals
(ResourceMapping mapping) Return an array of traversals that cover the given resource mapping to be operated on.boolean
Return whether the scope has additional mappings added to the input mappings during the scope building process.boolean
Return whether the scope has additional resources added due to additional resource mappings.void
refresh
(ResourceMapping[] mappings) Refresh the given mapping asynchronously.void
Remove a scope change listener.
-
Method Details
-
getProjects
IProject[] getProjects()Return the projects that bound this scope. The projects returned will depend on the type of context used to generate this scope. If the context is a local context, all workspace projects are returned. If it is a remote context, the projects are the same as those returned fromRemoteResourceMappingContext.getProjects()
- Returns:
- the projects that bound this scope
-
getContext
ResourceMappingContext getContext()Return the resource mapping context that the scope uses to obtain traversals from resource mappings in order to determine what resources are in the scope.- Returns:
- the resource mapping context that the scope uses to obtain traversals from resource mappings
- See Also:
-
getInputMappings
ResourceMapping[] getInputMappings()Return the array of mappings that acted as the input to the scope builder that was used to build this scope. This set usually come from a view selection but could come from another source. In most cases, clients will want to call thegetMappings()
method instead of this one as it returns the complete set of mappings to be operated on.- Returns:
- the set of mappings that acted as the input to the scope builder that was used to build this scope
-
asInputScope
ISynchronizationScope asInputScope()Return a scope that only contains the input mappings of this scope.- Returns:
- a scope that only contains the input mappings of this scope
-
getMappings
ResourceMapping[] getMappings()Return an array of all of the mappings to be operated on. The returned mappings were included in the operation during the scope building process. The returned mappings may be the same as the input mappings but may also be a super set. Clients can call thehasAdditionalMappings()
method to determine if the two sets are the same or not.- Returns:
- an array of all of the mappings to be operated on.
-
getTraversals
ResourceTraversal[] getTraversals()Return an array of traversals that cover the resource mappings to be operated on as returned by thegetMappings()
method. The traversals were calculated during the scope building process and cached with the scope.- Returns:
- the complete set of mappings to be operated on
-
getRoots
IResource[] getRoots()Return the resources that are the roots of this scope. The roots are determined by collecting the roots of the traversals that define this scope.- Returns:
- the resources that are the roots of this scope
-
contains
Return whether the given resource is contained in this scope. A resource is contained by the scope if it is contained in at least one of the traversals that define this scope.- Parameters:
resource
- the resource to be tested- Returns:
- whether the given resource is contained in this scope
-
addScopeChangeListener
Add a scope change listener that will get invoked when a property of the receiver changes. Adding a listener that is already added has no effect.- Parameters:
listener
- the listener to be added
-
removeScopeChangeListener
Remove a scope change listener. Removing an unregistered listener has no effect.- Parameters:
listener
- the listener to be removed
-
getTraversals
Return an array of traversals that cover the given resource mapping to be operated on. The traversals were calculated during the scope building process and cached with the scope.- Parameters:
mapping
- a resource mapping being operated on- Returns:
- the traversals that cover the given resource mapping (or
null
if the mapping is not contained in the input)
-
hasAdditionalMappings
boolean hasAdditionalMappings()Return whether the scope has additional mappings added to the input mappings during the scope building process.- Returns:
- whether the input has additional mappings added to the seed mappings
-
hasAdditonalResources
boolean hasAdditonalResources()Return whether the scope has additional resources added due to additional resource mappings.- Returns:
- whether the input has additional resources added due to additional resource mappings
-
getModelProviders
ModelProvider[] getModelProviders()Return all the model providers that have mappings in this scope.- Returns:
- all the model providers that have mappings in this scope
-
getMappings
Return all the mappings to be operated on for the given model provider id.- Parameters:
modelProviderId
- the id of the model provider- Returns:
- all the mappings for the given model provider id
-
getTraversals
Return the set of traversals that cover the mappings for the given model provider.- Parameters:
modelProviderId
- the model provider id- Returns:
- the set of traversals that cover the mappings for the given model provider
-
getMapping
Return the resource mapping in the scope associated with the given model object ornull
if there isn't one. This method has no knowledge of hierarchical models so it only matches directly against the mappings that are contained in the scope.- Parameters:
modelObject
- the model object- Returns:
- the mapping for the model object that is contained in this scope
-
refresh
Refresh the given mapping asynchronously. This method is called byISynchronizationScopeParticipant
instances when they detect changes that require the scope to be adjusted.- Parameters:
mappings
- the mappings to be refreshed.
-