Eclipse Platform
Release 3.2

org.eclipse.team.ui.mapping
Interface ISynchronizationCompareAdapter

All Known Implementing Classes:
SynchronizationCompareAdapter

public interface ISynchronizationCompareAdapter

The compare adapter provides compare support for the model objects associated with a model provider.

Clients should not implement this interface but should subclass SynchronizationCompareAdapter instead.

Since:
3.2

Method Summary
 ICompareInput asCompareInput(ISynchronizationContext context, Object o)
          Return a compare input for the given model object.
 String getName(ResourceMapping mapping)
          Get the name associated with the model object of the given mapping.
 String getPathString(ResourceMapping mapping)
          Get the path associated with the model object of the given mapping.
 boolean hasCompareInput(ISynchronizationContext context, Object object)
          Return whether their is a compare input associated with the given object.
 ResourceMapping[] restore(IMemento memento)
          Restore the previosuly saved resource mappings.
 void save(ResourceMapping[] mappings, IMemento memento)
          Save the given resource mappings from this adapters model provider into the given memento in a form that can be restored at a future time.
 

Method Detail

hasCompareInput

public boolean hasCompareInput(ISynchronizationContext context,
                               Object object)
Return whether their is a compare input associated with the given object. In otherwords, return true if asCompareInput(ISynchronizationContext, Object) would return a value and false if it would return null.

Parameters:
context - the synchronization context
object - the object.
Returns:
whether their is a compare input associated with the given object

asCompareInput

public ICompareInput asCompareInput(ISynchronizationContext context,
                                    Object o)
Return a compare input for the given model object. Creation of the input should be fast. Synchronization information calculations that are longer running should be performed in the ISynchronizationCompareInput.prepareInput(org.eclipse.compare.CompareConfiguration, IProgressMonitor) method. Clients should call this method once per context before obtaining any compare inputs from the adapter. A null should be returned if the model object is in-sync or otherwise cannot be compared.

Model providers can choose to return an instance of ISynchronizationCompareInput if they wish to tailor the compare editor used to show the compare input of provide an SaveableComparison in order to have more control over the save lifecycle during a merge.

Parameters:
context - the synchronization context
o - the model object
Returns:
a compare input or null if the model object is in-sync or otherwise cannot be compared.

getName

public String getName(ResourceMapping mapping)
Get the name associated with the model object of the given mapping. This name sould be suitable for display to the user.

Parameters:
mapping - the mapping
Returns:
the name of the mapping's model object

getPathString

public String getPathString(ResourceMapping mapping)
Get the path associated with the model object of the given mapping. Ths path sould be suitable for display to the user.

Parameters:
mapping - the mapping
Returns:
the path of the model object of the mapping

save

public void save(ResourceMapping[] mappings,
                 IMemento memento)
Save the given resource mappings from this adapters model provider into the given memento in a form that can be restored at a future time.

Parameters:
mappings - the resource mappings to save
memento - the memento where the mappings should be saved

restore

public ResourceMapping[] restore(IMemento memento)
Restore the previosuly saved resource mappings.

Parameters:
memento - a memento
Returns:
the mappings restored from the given memento

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.