Class AbstractResolution
java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.logical.resolver.AbstractResolution
- Direct Known Subclasses:
LocalModelResolution
,LocalModelsResolution
,ModelsResolution
Abstract super-class of resolving computations.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IResolutionContext
The context.protected DiagnosticSupport
The diagnostic.protected IImplicitDependencies
The implicit dependencies.protected final EMFCompareLogger
The loggerprotected final org.eclipse.core.runtime.SubMonitor
The monitor. -
Constructor Summary
ConstructorDescriptionAbstractResolution
(IResolutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> T
Executes the given callable as soon as there is no other computation running, and automatically runs "finalization" treatment once the computation is over, whatever its outcome (success or failure).protected Runnable
This provides the treatment that is run at the end of the computation, whatever its outcome.protected IImplicitDependencies
Returns the implicit dependencies which can be used to retrieve a set of files that should be part of the same logical model than a given file.protected int
getTicks()
Number of ticks to allocate to the progress monitor used for reporting progress.protected Set<org.eclipse.core.resources.IStorage>
resolveTraversal
(org.eclipse.core.resources.IFile file, Set<URI> bounds) Computes the traversal of the given file, excluding the given bounds if needed.
-
Field Details
-
context
The context. -
monitor
protected final org.eclipse.core.runtime.SubMonitor monitorThe monitor. -
diagnostic
The diagnostic. -
logger
The logger -
implicitDependencies
The implicit dependencies.
-
-
Constructor Details
-
AbstractResolution
public AbstractResolution(IResolutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Constructor.- Parameters:
context
- The resolution context, must not benull
monitor
- The progress monitor, can benull
-
-
Method Details
-
getImplicitDependencies
Returns the implicit dependencies which can be used to retrieve a set of files that should be part of the same logical model than a given file.- Returns:
- The
IImplicitDependencies
instance.
-
getTicks
protected int getTicks()Number of ticks to allocate to the progress monitor used for reporting progress.- Returns:
- The number of ticks to use, 100 by default but can be overridden if necessary.
-
call
Executes the given callable as soon as there is no other computation running, and automatically runs "finalization" treatment once the computation is over, whatever its outcome (success or failure). Adiagnostic
is instantiated before the computation and should be used thourghout this whole computation. It will be set tonull
before returning, whatever happens.- Type Parameters:
T
- The type of the returned value.- Parameters:
callable
- Treatment to run- Returns:
- The result of the treatment
-
getFinalizeResolvingRunnable
This provides the treatment that is run at the end of the computation, whatever its outcome. It is guaranteed to run once, in a block "finally", along with other required finalization treatments that are run systematically. There's no need to acquire a lock, this is guaranteed to have been done before, and it is released after this treatment ends.- Returns:
- The
Runnable
to run after having resolved resources.
-
asURISet
- Parameters:
storages
- The storages to transform, must not benull
.- Returns:
- A mutable set of
URI
s, may be empty but never)null
.
-
resolveTraversal
protected Set<org.eclipse.core.resources.IStorage> resolveTraversal(org.eclipse.core.resources.IFile file, Set<URI> bounds) Computes the traversal of the given file, excluding the given bounds if needed.- Parameters:
file
- File for which the traversal is neededbounds
- URI to exclude from the logical model computation in case both compared resources are part of the same logical model- Returns:
- A
Set
of the file's outgoing and incoming dependencies, never null but possibly empty.
-