Package org.eclipse.emf.compare.ide.ui.internal.logical.resolver

## Class ResourceDependencyLocalResolver

- java.lang.Object
- - org.eclipse.emf.compare.ide.ui.internal.logical.resolver.ResourceDependencyLocalResolver

All Implemented Interfaces:
  `IResourceDependencyLocalResolver`

    public class ResourceDependencyLocalResolver
    extends Object
    implements IResourceDependencyLocalResolver

The default implementation of the `IResourceDependencyProvider`.

### Constructor Summary

Constructors
`ResourceDependencyLocalResolver​(IResolutionContext context)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`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​(org.eclipse.core.resources.IFile file)`
`Iterable<URI>` `getDependenciesOf​(org.eclipse.core.resources.IFile file, Set<URI> bounds)`
`protected org.eclipse.core.resources.IResource` `getResolutionStartingPoint​(org.eclipse.core.resources.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​(org.eclipse.core.resources.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​(org.eclipse.core.runtime.IProgressMonitor monitor, DiagnosticSupport diagnostic, org.eclipse.core.resources.IFile... files)` Update the dependency graph to make sure that it contains the given file.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### ResourceDependencyLocalResolver

    public ResourceDependencyLocalResolver​(IResolutionContext context)

Constructor.

Parameters:
  `context` - The resolution context, must not be `null`

### Method Detail

#### getDependenciesOf

    public Iterable<URI> getDependenciesOf​(org.eclipse.core.resources.IFile file)

#### getDependenciesOf

    public Iterable<URI> getDependenciesOf​(org.eclipse.core.resources.IFile file,
                                           Set<URI> bounds)

#### updateChangedResources

    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.

Parameters:
  `resourceSet` - The resource set in which to load our temporary resources.
  `diagnostic` - The diagnostic.
  `tspm` - Monitor on which to report progress to the user.

#### demandResolve

    public void demandResolve​(SynchronizedResourceSet resourceSet,
                              URI uri,
                              DiagnosticSupport diagnostic,
                              ThreadSafeProgressMonitor tspm)

Description copied from interface: `IResourceDependencyLocalResolver`
Allows callers to launch the loading and resolution of the model pointed at by the given URI.

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.

Specified by:
  `demandResolve` in interface `IResourceDependencyLocalResolver`
Parameters:
  `resourceSet` - The resource set in which to load the resource.
  `uri` - The uri we are to try and load as a model.
  `diagnostic` - The diagnostic
  `tspm` - Monitor on which to report progress to the user.
See Also:
  `LocalResolveComputation`

#### isInContainer

    protected com.google.common.base.Predicate<URI> isInContainer​(org.eclipse.core.resources.IResource container)

This predicate can be used to check wether a given URI points to a workspace resource contained in the given container.

Parameters:
  `container` - The container in which we need the resources to be contained.
Returns:
  A ready to use predicate.

#### updateDependencies

    public void updateDependencies​(org.eclipse.core.runtime.IProgressMonitor monitor,
                                   DiagnosticSupport diagnostic,
                                   org.eclipse.core.resources.IFile... files)
                            throws InterruptedException

Update the dependency graph to make sure that it contains the given file.

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`.

Specified by:
  `updateDependencies` in interface `IResourceDependencyLocalResolver`
Parameters:
  `monitor` - The progress monitor.
  `diagnostic` - The diagnostic
  `files` - The files which we need to be present in the dependency graph.
Throws:
  `InterruptedException` - if the computation of dependencies is interrupted.

#### getResolutionStartingPoint

    protected org.eclipse.core.resources.IResource getResolutionStartingPoint​(org.eclipse.core.resources.IFile file)

Returns the starting point for the resolution of the given file's logical model according to `#getResolutionScope()`.

Parameters:
  `file` - The file which logical model we need to add to the current `dependencyGraph`.
Returns:
  Starting point for this file's logical model resolution.
See Also:
  `CrossReferenceResolutionScope`

#### hasChild

    public boolean hasChild​(URI parent,
                            URI candidate)