public class ResourceDependencyLocalResolver extends Object implements IResourceDependencyLocalResolver
IResourceDependencyProvider
.Constructor and Description |
---|
ResourceDependencyLocalResolver(IResolutionContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
demandResolve(SynchronizedResourceSet resourceSet,
URI uri,
DiagnosticSupport diagnostic,
ThreadSafeProgressMonitor tspm)
Allows callers to launch the loading and resolution of the model pointed at by the given URI.
|
Iterable<URI> |
getDependenciesOf(IFile file) |
Iterable<URI> |
getDependenciesOf(IFile file,
Set<URI> bounds) |
protected IResource |
getResolutionStartingPoint(IFile file)
Returns the starting point for the resolution of the given file's logical model according to
#getResolutionScope() . |
boolean |
hasChild(URI parent,
URI candidate) |
protected com.google.common.base.Predicate<URI> |
isInContainer(IResource container)
This predicate can be used to check wether a given URI points to a workspace resource contained in the
given container.
|
protected void |
updateChangedResources(SynchronizedResourceSet resourceSet,
DiagnosticSupport diagnostic,
ThreadSafeProgressMonitor tspm)
Checks the current state of our
resourceListener and updates the dependency graph for all
resources that have been changed since we last checked. |
void |
updateDependencies(IProgressMonitor monitor,
DiagnosticSupport diagnostic,
IFile... files)
Update the dependency graph to make sure that it contains the given file.
|
public ResourceDependencyLocalResolver(IResolutionContext context)
context
- The resolution context, must not be null
protected void updateChangedResources(SynchronizedResourceSet resourceSet, DiagnosticSupport diagnostic, ThreadSafeProgressMonitor tspm)
resourceListener
and updates the dependency graph for all
resources that have been changed since we last checked.resourceSet
- The resource set in which to load our temporary resources.diagnostic
- The diagnostic.tspm
- Monitor on which to report progress to the user.public void demandResolve(SynchronizedResourceSet resourceSet, URI uri, DiagnosticSupport diagnostic, ThreadSafeProgressMonitor tspm)
IResourceDependencyLocalResolver
This will check whether the given storage isn't already being resolved, then submit a job to the
#resolvingPool
to load and resolve the model in a separate thread.
demandResolve
in interface IResourceDependencyLocalResolver
resourceSet
- The resource set in which to load the resource.uri
- The uri we are to try and load as a model.diagnostic
- The diagnostictspm
- Monitor on which to report progress to the user.LocalResolveComputation
protected com.google.common.base.Predicate<URI> isInContainer(IResource container)
container
- The container in which we need the resources to be contained.public void updateDependencies(IProgressMonitor monitor, DiagnosticSupport diagnostic, IFile... files) throws InterruptedException
If the graph does not yet contain this file, we'll try and find cross-references outgoing from and/or
incoming to the given file, depending on the current resolution scope
.
updateDependencies
in interface IResourceDependencyLocalResolver
monitor
- The progress monitor.diagnostic
- The diagnosticfiles
- The files which we need to be present in the dependency graph.InterruptedException
- if the computation of dependencies is interrupted.protected IResource getResolutionStartingPoint(IFile file)
#getResolutionScope()
.file
- The file which logical model we need to add to the current dependencyGraph
.CrossReferenceResolutionScope
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.