Eclipse Platform
Release 3.2

org.eclipse.team.ui.mapping
Class SynchronizationCompareAdapter

java.lang.Object
  extended byorg.eclipse.team.ui.mapping.SynchronizationCompareAdapter
All Implemented Interfaces:
ISynchronizationCompareAdapter
Direct Known Subclasses:
AbstractSynchronizationCompareAdapter

public abstract class SynchronizationCompareAdapter
extends Object
implements ISynchronizationCompareAdapter

A abstract implementation of ISynchronizationCompareAdapter. Most of the methods are no-ops except for the asCompareInput(ISynchronizationContext, Object) which will convert file objects to an appropriate compare input.

Clients may subclass this class.

Since:
3.2

Constructor Summary
SynchronizationCompareAdapter()
           
 
Method Summary
 ICompareInput asCompareInput(ISynchronizationContext context, Object o)
          Default implementaton that is capable of returning a compare input for objects that adapt to IFile.
 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.
 
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 Detail

SynchronizationCompareAdapter

public SynchronizationCompareAdapter()
Method Detail

asCompareInput

public ICompareInput asCompareInput(ISynchronizationContext context,
                                    Object o)
Default implementaton that is capable of returning a compare input for objects that adapt to IFile. Subclasses shoudl override if compare inputs are availabel for other types of model elements.

Specified by:
asCompareInput in interface ISynchronizationCompareAdapter
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.
See Also:
ISynchronizationCompareAdapter.asCompareInput(ISynchronizationContext, Object)

hasCompareInput

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

Specified by:
hasCompareInput in interface ISynchronizationCompareAdapter
Parameters:
context - the synchronization context
object - the object.
Returns:
whether their is a compare input associated with the given object

getName

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

Specified by:
getName in interface ISynchronizationCompareAdapter
Parameters:
mapping - the mapping
Returns:
the name of the mapping's model object

getPathString

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

Specified by:
getPathString in interface ISynchronizationCompareAdapter
Parameters:
mapping - the mapping
Returns:
the path of the model object of the mapping

Eclipse Platform
Release 3.2

Guidelines for using Eclipse APIs.

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