public class IdenticalResourceMinimizer extends Object implements IModelMinimizer
This default implementation will consider that all files that are binary identical between the two (or three) sides of the comparison can be safely removed from the scope. Likewise, unmatched read-only files will be removed from the scope.
IModelMinimizer.Registry
Constructor and Description |
---|
IdenticalResourceMinimizer() |
Modifier and Type | Method and Description |
---|---|
protected boolean |
equals(org.eclipse.core.resources.IStorage left,
org.eclipse.core.resources.IStorage right)
Checks whether the two given (non-
null ) resources are identical. |
protected boolean |
equals(org.eclipse.core.resources.IStorage left,
org.eclipse.core.resources.IStorage right,
org.eclipse.core.resources.IStorage origin)
Checks whether the three given (non-
null ) resources are identical. |
void |
minimize(org.eclipse.core.resources.IFile file,
SynchronizationModel syncModel,
org.eclipse.core.runtime.IProgressMonitor monitor)
This will be called to reduce the number of resources in this model's traversals based on the given
starting point of the left logical model.
|
void |
minimize(SynchronizationModel syncModel,
org.eclipse.core.runtime.IProgressMonitor monitor)
This will be called to reduce the number of resources in this model's traversals.
|
protected org.eclipse.core.resources.IStorage |
removeLikeNamedStorageFrom(org.eclipse.core.resources.IStorage reference,
Set<? extends org.eclipse.core.resources.IStorage> candidates)
Looks up into the
candidates set for a storage which name matches that of the reference
storage, removing it if there is one. |
public void minimize(SynchronizationModel syncModel, org.eclipse.core.runtime.IProgressMonitor monitor)
minimize
in interface IModelMinimizer
syncModel
- The synchronization model to be minimized.monitor
- Monitor on which to report progress to the user.IModelMinimizer.minimize(org.eclipse.emf.compare.ide.ui.logical.SynchronizationModel,
org.eclipse.core.runtime.IProgressMonitor)
public void minimize(org.eclipse.core.resources.IFile file, SynchronizationModel syncModel, org.eclipse.core.runtime.IProgressMonitor monitor)
minimize
in interface IModelMinimizer
file
- The file that has been used as the starting point to resolve the left logical model.syncModel
- The synchronization model to be minimized.monitor
- Monitor on which to report progress to the user.IModelMinimizer.minimize(IFile, SynchronizationModel,
IProgressMonitor)
protected boolean equals(org.eclipse.core.resources.IStorage left, org.eclipse.core.resources.IStorage right, org.eclipse.core.resources.IStorage origin)
null
) resources are identical. This default
implementation only checks that the three are identical binary-wise.
Identical resources will be filtered out of the comparison scope.
left
- Left of the resources to consider.right
- Right of the resources to consider.origin
- Common ancestor of the left and right resources.true
if the given resources are to be considered identical, false
otherwise.protected boolean equals(org.eclipse.core.resources.IStorage left, org.eclipse.core.resources.IStorage right)
null
) resources are identical. This default
implementation only checks that the two are identical binary-wise.
Identical resources will be filtered out of the comparison scope.
left
- Left of the resources to consider.rightRight
- of the resources to consider.true
if the given resources are to be considered identical, false
otherwise.protected org.eclipse.core.resources.IStorage removeLikeNamedStorageFrom(org.eclipse.core.resources.IStorage reference, Set<? extends org.eclipse.core.resources.IStorage> candidates)
candidates
set for a storage which name matches that of the reference
storage, removing it if there is one.reference
- The storage for which we'll seek a match into candidates
.candidates
- The set of candidates into which to look up for a match to reference
.reference
, if any.
null
if none match.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.