public class SubscriberTeamStateProvider extends TeamStateProvider implements ISubscriberChangeListener
Subscriber to determine the synchronization
state. Repository provider types that have a subscriber will get one of these free through the adaptable mechanism.
If a repository provider type does not have a subscriber, or it a repository provider type wishes to se a custom
provider, they must adapt their RepositoryProviderType class to an appropriate ITeamStateProvider.
Clients may subclass this class.
USE_DECORATED_STATE_MASK| Constructor and Description |
|---|
SubscriberTeamStateProvider(Subscriber subscriber)
Create a provider that determines the synchronization state
from the subscriber.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose()
Called when the provider is no longer needed.
|
String[] |
getDecoratedProperties(Object element)
Return the set of property identifiers that represent the set of
properties that the team decorator would decorate for the given model
element.
|
ResourceMappingContext |
getResourceMappingContext(Object element)
Return a resource mapping context that gives access to the remote state
of the resources associated with the provider.
|
ITeamStateDescription |
getStateDescription(Object element,
int stateMask,
String[] properties,
IProgressMonitor monitor)
Return the state description for the given element.
|
protected Subscriber |
getSubscriber()
Return the subscriber associated with this tester.
|
protected int |
getSynchronizationState(Object element,
int stateMask,
IProgressMonitor monitor)
Obtain the synchronization state of the element from the subscriber
using
Subscriber.getState(ResourceMapping, int, IProgressMonitor) |
boolean |
hasDecoratedState(Object element)
Return whether the given element has any decorated state.
|
void |
subscriberResourceChanged(ISubscriberChangeEvent[] deltas)
Notifies this listener that some resources' subscriber properties have
changed.
|
addDecoratedStateChangeListener, fireStateChangeEvent, getDecoratedStateMask, isDecorationEnabled, removeDecoratedStateChangeListenerpublic SubscriberTeamStateProvider(Subscriber subscriber)
subscriber - the subscriber for this providerpublic boolean hasDecoratedState(Object element) throws CoreException
ITeamStateProviderhasDecoratedState in interface ITeamStateProviderelement - the element being decoratedCoreExceptionprotected final int getSynchronizationState(Object element, int stateMask, IProgressMonitor monitor) throws CoreException
Subscriber.getState(ResourceMapping, int, IProgressMonitor)element - the elementstateMask - the state mask that indicates which state flags are desiredmonitor - a progress monitorCoreExceptionpublic ITeamStateDescription getStateDescription(Object element, int stateMask, String[] properties, IProgressMonitor monitor) throws CoreException
ITeamStateProvidernull
is return if the element is not decorated or if decoration is disabled.
Only the portion of the synchronization state covered by
stateMask is returned. The stateMask should
be ITeamStateProvider.USE_DECORATED_STATE_MASK or the mask returned from
ITeamStateProvider.getDecoratedStateMask(Object) and the requested properties
should be null or the value returned from
ITeamStateProvider.getDecoratedProperties(Object) if the client wishes to obtain
the current decorated state.getStateDescription in interface ITeamStateProviderelement - the model elementstateMask - the mask that identifies which synchronization state flags are
desired if presentproperties - the set of properties that should be included in the result or
null if the decorated properties are desiredmonitor - a progress monitornullCoreExceptionpublic ResourceMappingContext getResourceMappingContext(Object element)
ITeamStateProviderRemoteResourceMappingContext is returned, then the client may
access the remote state.getResourceMappingContext in interface ITeamStateProviderelement - the element for which remote contents are desiredprotected final Subscriber getSubscriber()
public void dispose()
public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas)
ISubscriberChangeListenersubscriberResourceChanged in interface ISubscriberChangeListenerdeltas - detailing the kinds of changespublic String[] getDecoratedProperties(Object element)
ITeamStateProvidergetDecoratedProperties in interface ITeamStateProviderelement - the model element to be decoratedGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.