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
FieldsModifier and TypeFieldDescriptionprotected final IResolutionContextThe context.protected DiagnosticSupportThe diagnostic.protected IImplicitDependenciesThe implicit dependencies.protected final EMFCompareLoggerThe loggerprotected final org.eclipse.core.runtime.SubMonitorThe monitor. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractResolution(IResolutionContext context, org.eclipse.core.runtime.IProgressMonitor monitor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected <T> TExecutes 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 RunnableThis provides the treatment that is run at the end of the computation, whatever its outcome.protected IImplicitDependenciesReturns 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 intgetTicks()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 benullmonitor- 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
IImplicitDependenciesinstance.
-
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). Adiagnosticis instantiated before the computation and should be used thourghout this whole computation. It will be set tonullbefore 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
Runnableto run after having resolved resources.
-
asURISet
- Parameters:
storages- The storages to transform, must not benull.- Returns:
- A mutable set of
URIs, 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
Setof the file's outgoing and incoming dependencies, never null but possibly empty.
-