public class SubscriberTeamStateProvider extends TeamStateProvider implements ISubscriberChangeListener
A team state provider that makes use of a
Subscriberto 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
RepositoryProviderTypeclass to an appropriate
Clients may subclass this class.
Method SummaryModifier and TypeMethodDescription
dispose()Called when the provider is no longer needed.
StringReturn the set of property identifiers that represent the set of properties that the team decorator would decorate for the given model element.Return a resource mapping context that gives access to the remote state of the resources associated with the provider.Return the state description for the given element.
protected final SubscriberReturn the subscriber associated with this tester.
protected final intObtain the synchronization state of the element.
booleanReturn whether the given element has any decorated state.
voidNotifies this listener that some resources' subscriber properties have changed.
Methods inherited from class org.eclipse.team.ui.synchronize.TeamStateProvider
addDecoratedStateChangeListener, fireStateChangeEvent, getDecoratedStateMask, isDecorationEnabled, removeDecoratedStateChangeListener
(Subscriber subscriber)Create a provider that determines the synchronization state from the subscriber. This method registers this provider as a listener on the subscriber in order to know when to fire state change events.
subscriber- the subscriber for this provider
hasDecoratedStateReturn whether the given element has any decorated state.
getSynchronizationStateprotected final int getSynchronizationState
(Object element, int stateMask, IProgressMonitor monitor) throws CoreExceptionObtain the synchronization state of the element. If the model provider for the element adapts to an ISynchronizationCompareAdapter, then the adapter is used to determine the synchronization state. Others, the state is obtained from the subscriber using
Subscriber.getState(ResourceMapping, int, IProgressMonitor)
element- the element
stateMask- the state mask that indicates which state flags are desired
monitor- a progress monitor
- the synchronization state of the element
CoreException- if operation failed
getStateDescriptionpublic ITeamStateDescription getStateDescription
(Object element, int stateMask, String properties, IProgressMonitor monitor) throws CoreExceptionReturn the state description for the given element. A
nullis return if the element is not decorated or if decoration is disabled. Only the portion of the synchronization state covered by
stateMaskis returned. The
ITeamStateProvider.USE_DECORATED_STATE_MASKor the mask returned from
ITeamStateProvider.getDecoratedStateMask(Object)and the requested properties should be
nullor the value returned from
ITeamStateProvider.getDecoratedProperties(Object)if the client wishes to obtain the current decorated state.
- Specified by:
element- the model element
stateMask- the mask that identifies which synchronization state flags are desired if present
properties- the set of properties that should be included in the result or
nullif the decorated properties are desired
monitor- a progress monitor
- the state for the given element or
CoreException- if an error occurs
getResourceMappingContextReturn a resource mapping context that gives access to the remote state of the resources associated with the provider. If a
RemoteResourceMappingContextis returned, then the client may access the remote state.
getSubscriberprotected final Subscriber getSubscriber()Return the subscriber associated with this tester.
- the subscriber associated with this tester.
disposepublic void dispose()Called when the provider is no longer needed. This method stops listening to the subscriber. Subclasses may extend this method but must call this method if they do.
subscriberResourceChangedpublic void subscriberResourceChanged
(ISubscriberChangeEvent deltas)Description copied from interface:
ISubscriberChangeListenerNotifies 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.
getDecoratedPropertiesReturn the set of property identifiers that represent the set of properties that the team decorator would decorate for the given model element.