Eclipse Platform v3.1

org.eclipse.team.internal.ccvs.core
Class CVSMergeSubscriber

java.lang.Object
  extended by org.eclipse.team.core.subscribers.Subscriber
      extended by org.eclipse.team.core.variants.ResourceVariantTreeSubscriber
          extended by org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber
              extended by org.eclipse.team.internal.ccvs.core.CVSMergeSubscriber
All Implemented Interfaces:
EventListener, IResourceChangeListener, ISubscriberChangeListener

public class CVSMergeSubscriber
extends CVSSyncTreeSubscriber
implements IResourceChangeListener, ISubscriberChangeListener

A CVSMergeSubscriber is responsible for maintaining the remote trees for a merge into the workspace. The remote trees represent the CVS revisions of the start and end points (version or branch) of the merge. This subscriber stores the remote handles in the resource tree sync info slot. When the merge is cancelled this sync info is cleared. A merge can persist between workbench sessions and thus can be used as an ongoing merge. TODO: Is the merge subscriber interested in workspace sync info changes? TODO: Do certain operations (e.g. replace with) invalidate a merge subscriber? TODO: How to ensure that sync info is flushed when merge roots are deleted?


Field Summary
static String ID
           
static String ID_MODAL
           
 
Fields inherited from class org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber
SYNC_KEY_QUALIFIER
 
Constructor Summary
CVSMergeSubscriber(IResource[] roots, CVSTag start, CVSTag end)
           
CVSMergeSubscriber(QualifiedName id, IResource[] roots, CVSTag start, CVSTag end)
           
 
Method Summary
 void cancel()
           
 boolean equals(Object other)
           
protected  IResourceVariantTree getBaseTree()
          Return the base resource variant tree.
protected  boolean getCacheFileContentsHint()
           
 CVSTag getEndTag()
           
protected  IResourceVariantTree getRemoteTree()
          Return the remote resource variant tree.
 CVSTag getStartTag()
           
protected  SyncInfo getSyncInfo(IResource local, IResourceVariant base, IResourceVariant remote)
          Method that creates an instance of SyncInfo for the provided local, base and remote resource variants.
 boolean isMerged(IResource resource)
          Return whether the given resource has been merged with its corresponding remote.
 boolean isSupervised(IResource resource)
          Returns true if this resource is supervised by this subscriber.
 void merged(IResource[] resources)
           
 void resourceChanged(IResourceChangeEvent event)
          Notifies this listener that some resource changes are happening, or have already happened.
 IResource[] roots()
          Returns the list of root resources this subscriber considers for synchronization.
 void subscriberResourceChanged(ISubscriberChangeEvent[] deltas)
          Notifies this listener that some resources' subscriber properties have changed.
 
Methods inherited from class org.eclipse.team.internal.ccvs.core.CVSSyncTreeSubscriber
getId, getName, getResourceComparator, getSyncInfo, isThreeWay, rootsEqual
 
Methods inherited from class org.eclipse.team.core.variants.ResourceVariantTreeSubscriber
members, refresh
 
Methods inherited from class org.eclipse.team.core.subscribers.Subscriber
addListener, collectOutOfSync, fireTeamResourceChange, removeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
See Also:
Constant Field Values

ID_MODAL

public static final String ID_MODAL
See Also:
Constant Field Values
Constructor Detail

CVSMergeSubscriber

public CVSMergeSubscriber(IResource[] roots,
                          CVSTag start,
                          CVSTag end)

CVSMergeSubscriber

public CVSMergeSubscriber(QualifiedName id,
                          IResource[] roots,
                          CVSTag start,
                          CVSTag end)
Method Detail

getSyncInfo

protected SyncInfo getSyncInfo(IResource local,
                               IResourceVariant base,
                               IResourceVariant remote)
                        throws TeamException
Description copied from class: ResourceVariantTreeSubscriber
Method that creates an instance of SyncInfo for the provided local, base and remote resource variants. Can be overridden by subclasses.

Overrides:
getSyncInfo in class CVSSyncTreeSubscriber
Parameters:
local - the local resource
base - the base resource variant or null
remote - the remote resource variant or null
Returns:
the SyncInfo containing the provided resources
Throws:
TeamException

merged

public void merged(IResource[] resources)
            throws TeamException
Throws:
TeamException

cancel

public void cancel()

roots

public IResource[] roots()
Description copied from class: Subscriber
Returns the list of root resources this subscriber considers for synchronization. A client should call this method first then can safely call members to navigate the resources managed by this subscriber.

Specified by:
roots in class Subscriber
Returns:
a list of resources

isSupervised

public boolean isSupervised(IResource resource)
                     throws TeamException
Description copied from class: Subscriber
Returns true if this resource is supervised by this subscriber. A supervised resource is one for which this subscriber maintains the synchronization state. Supervised resources are the only resources returned when members(IResource) was invoked with the parent of the resource. Returns false in all other cases.

Overrides:
isSupervised in class CVSSyncTreeSubscriber
Returns:
true if this resource is supervised, and false otherwise
Throws:
TeamException

getStartTag

public CVSTag getStartTag()

getEndTag

public CVSTag getEndTag()

resourceChanged

public void resourceChanged(IResourceChangeEvent event)
Description copied from interface: IResourceChangeListener
Notifies this listener that some resource changes are happening, or have already happened.

The supplied event gives details. This event object (and the resource delta within it) is valid only for the duration of the invocation of this method.

Note: This method is called by the platform; it is not intended to be called directly by clients.

Note that during resource change event notification, further changes to resources may be disallowed.

Specified by:
resourceChanged in interface IResourceChangeListener
Parameters:
event - the resource change event
See Also:
IResourceDelta

isMerged

public boolean isMerged(IResource resource)
                 throws TeamException
Return whether the given resource has been merged with its corresponding remote.

Parameters:
resource - the local resource
Returns:
boolean
Throws:
TeamException

subscriberResourceChanged

public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas)
Description copied from interface: ISubscriberChangeListener
Notifies this listener that some resources' subscriber properties have changed. The changes have already happened. For example, a resource's base revision may have changed. The resource tree may or may not be open for modification when this method is invoked.

Specified by:
subscriberResourceChanged in interface ISubscriberChangeListener
Parameters:
deltas - detailing the kinds of changes

getBaseTree

protected IResourceVariantTree getBaseTree()
Description copied from class: ResourceVariantTreeSubscriber
Return the base resource variant tree.

Specified by:
getBaseTree in class ResourceVariantTreeSubscriber

getRemoteTree

protected IResourceVariantTree getRemoteTree()
Description copied from class: ResourceVariantTreeSubscriber
Return the remote resource variant tree.

Specified by:
getRemoteTree in class ResourceVariantTreeSubscriber

getCacheFileContentsHint

protected boolean getCacheFileContentsHint()
Overrides:
getCacheFileContentsHint in class CVSSyncTreeSubscriber

equals

public boolean equals(Object other)
Overrides:
equals in class Object

Eclipse Platform v3.1