Package org.eclipse.team.ui.mapping
Interface ITeamStateProvider
- All Known Implementing Classes:
SubscriberTeamStateProvider
,TeamStateProvider
public interface ITeamStateProvider
A team state provider is used by the
SynchronizationStateTester
to obtain the team state for model elements. A team
state provider is associated with a RepositoryProviderType
using the
adaptable mechanism. A default decoration provider that uses the subscriber
of the type is provided.
This interface is not intended to be implemented by clients. Clients should
instead subclass TeamStateProvider
or
SubscriberTeamStateProvider
.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
A state mask that can be passed to thegetStateDescription(Object, int, String[], IProgressMonitor)
method to indicate that only the decorated state flags are desired. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a decorated state change listener to the provider.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.int
getDecoratedStateMask
(Object element) Return the mask that indicates what state the appropriate team decorator is capable of decorating.getResourceMappingContext
(Object element) Return a resource mapping context that gives access to the remote state of the resources associated with the provider.getStateDescription
(Object element, int stateMask, String[] properties, IProgressMonitor monitor) Return the state description for the given element.boolean
hasDecoratedState
(Object element) Return whether the given element has any decorated state.boolean
isDecorationEnabled
(Object element) Return whether decoration is enabled for the given model element.void
Remove the decorated state change listener to the provider.
-
Field Details
-
USE_DECORATED_STATE_MASK
static final int USE_DECORATED_STATE_MASKA state mask that can be passed to thegetStateDescription(Object, int, String[], IProgressMonitor)
method to indicate that only the decorated state flags are desired. It is equivalent to passing he mask returned fromgetDecoratedStateMask(Object)
;- See Also:
-
-
Method Details
-
isDecorationEnabled
Return whether decoration is enabled for the given model element. If decoration is not enabled, the model does not need to fire label change events when the team state of the element changes.- Parameters:
element
- the model element- Returns:
- whether decoration is enabled for the given model element
-
hasDecoratedState
Return whether the given element has any decorated state.- Parameters:
element
- the element being decorated- Returns:
- whether the given element has any decorated state
- Throws:
CoreException
- if an error occurs
-
getDecoratedStateMask
Return the mask that indicates what state the appropriate team decorator is capable of decorating. Clients can used this to obtain the current decorated state fromgetStateDescription(Object, int, String[], IProgressMonitor)
in order to determine if the decorated state has changed.The state mask can consist of the following standard flags:
- The diff kinds of
IDiff.ADD
,IDiff.REMOVE
andIDiff.CHANGE
. - The directions
IThreeWayDiff.INCOMING
andIThreeWayDiff.OUTGOING
.
The mask can also consist of flag bits that are unique to the repository provider associated with the resources that the element maps to.
- Parameters:
element
- the model element to be decorated- Returns:
- the mask that indicates what state the appropriate team decorator will decorate
- See Also:
- The diff kinds of
-
getDecoratedProperties
Return the set of property identifiers that represent the set of properties that the team decorator would decorate for the given model element.- Parameters:
element
- the model element to be decorated- Returns:
- the set of decorated properties
-
getStateDescription
ITeamStateDescription getStateDescription(Object element, int stateMask, String[] properties, IProgressMonitor monitor) throws CoreException Return the state description for the given element. Anull
is return if the element is not decorated or if decoration is disabled. Only the portion of the synchronization state covered bystateMask
is returned. ThestateMask
should beUSE_DECORATED_STATE_MASK
or the mask returned fromgetDecoratedStateMask(Object)
and the requested properties should benull
or the value returned fromgetDecoratedProperties(Object)
if the client wishes to obtain the current decorated state.- Parameters:
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 ornull
if the decorated properties are desiredmonitor
- a progress monitor- Returns:
- the state for the given element or
null
- Throws:
CoreException
- if an error occurs
-
getResourceMappingContext
Return a resource mapping context that gives access to the remote state of the resources associated with the provider. If aRemoteResourceMappingContext
is returned, then the client may access the remote state.- Parameters:
element
- the element for which remote contents are desired- Returns:
- a resource mapping context that gives access to the remote state of the resources associated with the provider
-
addDecoratedStateChangeListener
Add a decorated state change listener to the provider. Adding the same listener more than once has no effect.- Parameters:
listener
- the listener
-
removeDecoratedStateChangeListener
Remove the decorated state change listener to the provider. Removing a listener that is not registered has no effect.- Parameters:
listener
- the listener
-