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 Details

    • ResourceDependencyLocalResolver

      public ResourceDependencyLocalResolver(IResolutionContext context)
      Constructor.
      Parameters:
      context - The resolution context, must not be null
  • Method Details

    • 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:
    • hasChild

      public boolean hasChild(URI parent, URI candidate)