Package org.eclipse.team.ui.mapping
Class SynchronizationCompareAdapter
java.lang.Object
org.eclipse.team.ui.mapping.SynchronizationCompareAdapter
- All Implemented Interfaces:
ISynchronizationCompareAdapter
- Direct Known Subclasses:
AbstractSynchronizationCompareAdapter
public abstract class SynchronizationCompareAdapter
extends Object
implements ISynchronizationCompareAdapter
An abstract implementation of
ISynchronizationCompareAdapter
.
Clients may subclass this class.
- Since:
- 3.2
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionasCompareInput
(ISynchronizationContext context, Object o) Default implementation that is capable of returning a compare input for objects that adapt toIFile
.getImageDescriptor
(ResourceMapping mapping) Return an image descriptor that can be displayed as an icon for the model object of the given resource mapping.getName
(ResourceMapping mapping) Get the name associated with the model object of the given mapping.getPathString
(ResourceMapping mapping) Get the path associated with the model object of the given mapping.int
getSynchronizationState
(ITeamStateProvider provider, ResourceMapping mapping, int stateMask, IProgressMonitor monitor) Return the synchronization state of the resource mapping with respect to the given team state provider.boolean
hasCompareInput
(ISynchronizationContext context, Object object) Return whether their is a compare input associated with the given object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.eclipse.team.ui.mapping.ISynchronizationCompareAdapter
restore, save
-
Constructor Details
-
SynchronizationCompareAdapter
public SynchronizationCompareAdapter()
-
-
Method Details
-
asCompareInput
Default implementation that is capable of returning a compare input for objects that adapt toIFile
. Subclasses should override if compare inputs are available for other types of model elements.- Specified by:
asCompareInput
in interfaceISynchronizationCompareAdapter
- Parameters:
context
- the synchronization contexto
- the model object- Returns:
- a compare input or
null
if the model object is in-sync or otherwise cannot be compared. - See Also:
-
hasCompareInput
Description copied from interface:ISynchronizationCompareAdapter
Return whether their is a compare input associated with the given object. In other words, returntrue
ifISynchronizationCompareAdapter.asCompareInput(ISynchronizationContext, Object)
would return a value andfalse
if it would returnnull
.- Specified by:
hasCompareInput
in interfaceISynchronizationCompareAdapter
- Parameters:
context
- the synchronization contextobject
- the object.- Returns:
- whether their is a compare input associated with the given object
-
getName
Description copied from interface:ISynchronizationCompareAdapter
Get the name associated with the model object of the given mapping. This name should be suitable for display to the user.- Specified by:
getName
in interfaceISynchronizationCompareAdapter
- Parameters:
mapping
- the mapping- Returns:
- the name of the mapping's model object
-
getPathString
Description copied from interface:ISynchronizationCompareAdapter
Get the path associated with the model object of the given mapping. This path should be suitable for display to the user.- Specified by:
getPathString
in interfaceISynchronizationCompareAdapter
- Parameters:
mapping
- the mapping- Returns:
- the path of the model object of the mapping
-
getImageDescriptor
Description copied from interface:ISynchronizationCompareAdapter
Return an image descriptor that can be displayed as an icon for the model object of the given resource mapping.- Specified by:
getImageDescriptor
in interfaceISynchronizationCompareAdapter
- Parameters:
mapping
- the mapping- Returns:
- an image descriptor that can be displayed as an icon for the model object of the given resource mapping
-
getSynchronizationState
public int getSynchronizationState(ITeamStateProvider provider, ResourceMapping mapping, int stateMask, IProgressMonitor monitor) throws CoreException Return the synchronization state of the resource mapping with respect to the given team state provider. This method is invoked from instances ofITeamStateProvider
when the synchronization state description for an element is requested.- Specified by:
getSynchronizationState
in interfaceISynchronizationCompareAdapter
- Parameters:
provider
- the team state providermapping
- the elementstateMask
- the state mask that indicates which state flags are desiredmonitor
- a progress monitor- Returns:
- the synchronization state of the element or -1 if the calculation of the state should be done using the resources of the mapping.
- Throws:
CoreException
- on failures- Since:
- 3.3
-