Class ComparisonScopeBuilder

java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.logical.ComparisonScopeBuilder

public final class ComparisonScopeBuilder extends Object
This will be used by EMF Compare in order to construct its comparison scope given a "starting point".

A single file is not always a single EMF model, nor is an EMF model always stored in a single file. This will be used to resolve all physical resources composing the logical model we are to compare, minimize this set to the potential changed candidates, and construct the actual comparison scope.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a builder given its model resolver and minimizer.
    Constructs a builder given its model resolver and minimizer, along with the storage accessor for remote data.
  • Method Summary

    Modifier and Type
    Method
    Description
    build(org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.compare.ITypedElement origin, org.eclipse.core.runtime.IProgressMonitor monitor)
    Builds a comparison scope from the given starting elements.
    build(org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.core.runtime.IProgressMonitor monitor)
    Builds a comparison scope from the given two starting elements.
    create(org.eclipse.compare.ICompareContainer container, org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.compare.ITypedElement origin, org.eclipse.core.runtime.IProgressMonitor monitor)
    Constructs the comparison scope corresponding to the given typed elements.
    create(SynchronizationModel synchronizationModel, org.eclipse.core.runtime.IProgressMonitor monitor)
    Creates the comparison scope corresponding to the given synchronization model, with no further operation on it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ComparisonScopeBuilder

      public ComparisonScopeBuilder(IModelResolver resolver, IModelMinimizer minimizer)
      Constructs a builder given its model resolver and minimizer.
      Parameters:
      resolver - The resolver we'll use to resolve the logical models of this scope.
      minimizer - The minimizer that will be use to reduce the comparison scope before construction.
    • ComparisonScopeBuilder

      public ComparisonScopeBuilder(IModelResolver resolver, IModelMinimizer minimizer, IStorageProviderAccessor storageAccessor)
      Constructs a builder given its model resolver and minimizer, along with the storage accessor for remote data.
      Parameters:
      resolver - The resolver we'll use to resolve the logical models of this scope.
      minimizer - The minimizer that will be use to reduce the comparison scope before construction.
      storageAccessor - The storage accessor we'll use to access remote resource variants. May be null, in which case we'll only use local content.
  • Method Details

    • build

      public IComparisonScope build(org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.core.runtime.IProgressMonitor monitor)
      Builds a comparison scope from the given two starting elements.
      Parameters:
      left - The element that will be used as the starting point to resolve the left logical model.
      right - Element that will be used as the starting point to resolve the left logical model.
      monitor - The monitor on which to report progress information to the user.
      Returns:
      The newly created comparison scope.
    • build

      public IComparisonScope build(org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.compare.ITypedElement origin, org.eclipse.core.runtime.IProgressMonitor monitor)
      Builds a comparison scope from the given starting elements.
      Parameters:
      left - The element that will be used as the starting point to resolve the left logical model.
      right - Element that will be used as the starting point to resolve the left logical model.
      origin - The origin resource, starting point of the logical model we are to resolve as the origin one. Can be null.
      monitor - The monitor on which to report progress information to the user.
      Returns:
      The newly created comparison scope.
    • create

      public static IComparisonScope create(org.eclipse.compare.ICompareContainer container, org.eclipse.compare.ITypedElement left, org.eclipse.compare.ITypedElement right, org.eclipse.compare.ITypedElement origin, org.eclipse.core.runtime.IProgressMonitor monitor)
      Constructs the comparison scope corresponding to the given typed elements.
      Parameters:
      left - Left of the compared elements.
      right - Right of the compared elements.
      origin - Common ancestor of the left and right compared elements.
      monitor - Monitor to report progress on.
      Returns:
      The created comparison scope.
    • create

      public static IComparisonScope create(SynchronizationModel synchronizationModel, org.eclipse.core.runtime.IProgressMonitor monitor) throws org.eclipse.core.runtime.OperationCanceledException
      Creates the comparison scope corresponding to the given synchronization model, with no further operation on it.

      This internal API is only intended for use by the resource mapping mergers and is not meant to be referenced.

      Parameters:
      synchronizationModel - The synchronization model describing the traversals for which a comparison scope is needed.
      monitor - Monitor on which to report progress information to the user.
      Returns:
      The created comparison scope.
      Throws:
      org.eclipse.core.runtime.OperationCanceledException - if the user cancels (or has already canceled) the operation through the given monitor.
      Restriction:
      This method is not intended to be referenced by clients.