Interface IModelResolver

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean canResolve​(org.eclipse.core.resources.IStorage sourceStorage)
      This will be used in order to determine whether this resolver can be used for the given storage.
      void dispose()
      This will be called when the contributing plugin of this class is about to be stopped.
      void initialize()
      This will be called as soon as the class is created by the registry.
      StorageTraversal resolveLocalModel​(org.eclipse.core.resources.IResource resource, org.eclipse.core.runtime.IProgressMonitor monitor)
      This will be called by Team in order to determine whether a given file can be compared alone, or if it needs to be compared along with others (and, thus, compared from the synchronize view).
      SynchronizationModel resolveLocalModels​(org.eclipse.core.resources.IResource left, org.eclipse.core.resources.IResource right, org.eclipse.core.resources.IResource origin, org.eclipse.core.runtime.IProgressMonitor monitor)
      Called by EMF Compare in order to resolve the logical models corresponding to the given IResources.
      SynchronizationModel resolveModels​(IStorageProviderAccessor storageAccessor, org.eclipse.core.resources.IStorage left, org.eclipse.core.resources.IStorage right, org.eclipse.core.resources.IStorage origin, org.eclipse.core.runtime.IProgressMonitor monitor)
      This will be called by EMF Compare in order to resolve the whole logical models containing the given storages.
    • Method Detail

      • resolveLocalModels

        SynchronizationModel resolveLocalModels​(org.eclipse.core.resources.IResource left,
                                                org.eclipse.core.resources.IResource right,
                                                org.eclipse.core.resources.IResource origin,
                                                org.eclipse.core.runtime.IProgressMonitor monitor)
                                         throws InterruptedException
        Called by EMF Compare in order to resolve the logical models corresponding to the given IResources. Only local data is available.
        Parameters:
        left - The file that will be considered as the "starting point" of the traversal to resolve as the left logical model.
        right - "starting point" of the traversal to resolve as the right logical model.
        origin - "starting point" of the traversal to resolve as the origin logical model (common ancestor of left and right). Can be null.
        monitor - Monitor on which to report progress to the user.
        Returns:
        A traversal corresponding to all resources composing the given file's logical model.
        Throws:
        InterruptedException - Thrown if the resolution is cancelled or interrupted one way or another.
      • resolveModels

        SynchronizationModel resolveModels​(IStorageProviderAccessor storageAccessor,
                                           org.eclipse.core.resources.IStorage left,
                                           org.eclipse.core.resources.IStorage right,
                                           org.eclipse.core.resources.IStorage origin,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws InterruptedException
        This will be called by EMF Compare in order to resolve the whole logical models containing the given storages. Since this may be either a local or remote model, all I/O should go through the given storage accessor.
        Parameters:
        storageAccessor - The accessor that can be used to retrieve synchronization information between our resources.
        left - The storage that will be considered as the "starting point" of the traversal to resolve as the left logical model.
        right - "starting point" of the traversal to resolve as the right logical model.
        origin - "starting point" of the traversal to resolve as the origin logical model (common ancestor of left and right). Can be null.
        monitor - Monitor on which to report progress to the user.
        Returns:
        A traversal corresponding to all resources composing the given file's logical model.
        Throws:
        InterruptedException - Thrown if the resolution is cancelled or interrupted one way or another.
      • resolveLocalModel

        StorageTraversal resolveLocalModel​(org.eclipse.core.resources.IResource resource,
                                           org.eclipse.core.runtime.IProgressMonitor monitor)
                                    throws InterruptedException
        This will be called by Team in order to determine whether a given file can be compared alone, or if it needs to be compared along with others (and, thus, compared from the synchronize view). Note that only local data is available here.
        Parameters:
        resource - The workspace resource for which we need a traversal.
        monitor - Monitor on which to report progress to the user.
        Returns:
        A traversal corresponding to all resources composing the given file's logical model.
        Throws:
        InterruptedException - Thrown if the resolution is cancelled or interrupted one way or another.
      • canResolve

        boolean canResolve​(org.eclipse.core.resources.IStorage sourceStorage)
        This will be used in order to determine whether this resolver can be used for the given storage. For each given storage, the resolver with the highest ranking will be selected for resolution. This test should be fast.
        Parameters:
        sourceStorage - The resource we're trying to resolve the logical model of. This will always be the "source" or "left" variant of the compared resource.
        Returns:
        true if this resolver is capable of handling the given storage, false otherwise.
      • initialize

        void initialize()
        This will be called as soon as the class is created by the registry. Clients can override if they need to set up their resolver for use.
      • dispose

        void dispose()
        This will be called when the contributing plugin of this class is about to be stopped. Clients can override to get rid of any state they've maintained within their resolver.