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.
|
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, removeDecoratedStateChangeListener
public SubscriberTeamStateProvider(Subscriber subscriber)
subscriber
- the subscriber for this providerpublic boolean hasDecoratedState(Object element) throws CoreException
ITeamStateProvider
hasDecoratedState
in interface ITeamStateProvider
element
- the element being decoratedCoreException
protected 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 monitorCoreException
public ITeamStateDescription getStateDescription(Object element, int stateMask, String[] properties, IProgressMonitor monitor) throws CoreException
ITeamStateProvider
null
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 ITeamStateProvider
element
- 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 monitornull
CoreException
public ResourceMappingContext getResourceMappingContext(Object element)
ITeamStateProvider
RemoteResourceMappingContext
is returned, then the client may
access the remote state.getResourceMappingContext
in interface ITeamStateProvider
element
- the element for which remote contents are desiredprotected final Subscriber getSubscriber()
public void dispose()
public void subscriberResourceChanged(ISubscriberChangeEvent[] deltas)
ISubscriberChangeListener
subscriberResourceChanged
in interface ISubscriberChangeListener
deltas
- detailing the kinds of changespublic String[] getDecoratedProperties(Object element)
ITeamStateProvider
getDecoratedProperties
in interface ITeamStateProvider
element
- the model element to be decorated
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.