Eclipse Platform
Release 3.3

org.eclipse.team.ui.mapping
Class SynchronizationLabelProvider

java.lang.Object
  extended byorg.eclipse.team.ui.synchronize.AbstractSynchronizeLabelProvider
      extended byorg.eclipse.team.ui.mapping.SynchronizationLabelProvider
All Implemented Interfaces:
IBaseLabelProvider, ICommonLabelProvider, IDescriptionProvider, IFontProvider, ILabelProvider, IMementoAware
Direct Known Subclasses:
AbstractSynchronizationLabelProvider

public abstract class SynchronizationLabelProvider
extends AbstractSynchronizeLabelProvider
implements ICommonLabelProvider, IFontProvider

A label provider wrapper that adds synchronization image and/or text decorations to the image and label obtained from the delegate provider.

Since:
3.2

Constructor Summary
SynchronizationLabelProvider()
           
 
Method Summary
 ISynchronizationContext getContext()
          Return the synchronization context associated with the view to which this label provider applies.
 String getDescription(Object anElement)
           Provide a description for the status bar view, if available.
 ICommonContentExtensionSite getExtensionSite()
          Return the Common Navigator extension site for this label provider.
 Image getImage(Object element)
          Returns the image for the label of the given element.
protected  Object getModelRoot()
          Return the root object for the model.
 ISynchronizationScope getScope()
          Return the resource mapping scope associated with the view to which this label provider applies.
 String getText(Object element)
          Returns the text for the label of the given element.
 void init(ICommonContentExtensionSite site)
          Initialize the label provider with the given configuration.
protected  boolean isDecorationEnabled()
          Return whether the label provider should decorate with the synchronization state.
 void restoreState(IMemento aMemento)
           Restore the previous state of any actions using the flags in aMemento.
 void saveState(IMemento aMemento)
           Save flags in aMemento to remember the state of any actions that persist from session to session.
 
Methods inherited from class org.eclipse.team.ui.synchronize.AbstractSynchronizeLabelProvider
addListener, decorateImage, decorateText, dispose, getDelegateImage, getDelegateLabelProvider, getDelegateText, getDiff, getFont, getMarkerSeverity, hasDecendantConflicts, isBusy, isIncludeOverlays, isLabelProperty, isSyncInfoInTextEnabled, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider
addListener, dispose, isLabelProperty, removeListener
 
Methods inherited from interface org.eclipse.jface.viewers.IFontProvider
getFont
 

Constructor Detail

SynchronizationLabelProvider

public SynchronizationLabelProvider()
Method Detail

init

public void init(ICommonContentExtensionSite site)
Description copied from interface: ICommonLabelProvider
Initialize the label provider with the given configuration.

Specified by:
init in interface ICommonLabelProvider
Parameters:
site - The extension site provides information that some extensions will find useful to configure themselves properly in a particular viewer.
See Also:
ICommonContentProvider

getContext

public ISynchronizationContext getContext()
Return the synchronization context associated with the view to which this label provider applies. A null is returned if no context is available.

Returns:
the synchronization context or null

getScope

public ISynchronizationScope getScope()
Return the resource mapping scope associated with the view to which this label provider applies. A null is returned if no scope is available.

Returns:
the resource mapping scope or null

restoreState

public void restoreState(IMemento aMemento)
Description copied from interface: IMementoAware

Restore the previous state of any actions using the flags in aMemento. This method allows the state of any actions that persist from session to session to be restored.

Specified by:
restoreState in interface IMementoAware
Parameters:
aMemento - A memento that was given to the view part to restore its state.

saveState

public void saveState(IMemento aMemento)
Description copied from interface: IMementoAware

Save flags in aMemento to remember the state of any actions that persist from session to session.

Extensions should qualify any keys stored in the memento with their plugin id

Specified by:
saveState in interface IMementoAware
Parameters:
aMemento - A memento that was given to the view part to save its state.

getDescription

public String getDescription(Object anElement)
Description copied from interface: IDescriptionProvider

Provide a description for the status bar view, if available. A default string of the form "(x) items selected" will be used if this method choosed to return null.

The empty string ("") will be respected as a valid value if returned. Return null if the extension defers to the default method of supplying status bar descriptions.

Specified by:
getDescription in interface IDescriptionProvider
Parameters:
anElement - The element selected in the Navigator
Returns:
A description for the status bar view, or null if not available.

isDecorationEnabled

protected boolean isDecorationEnabled()
Description copied from class: AbstractSynchronizeLabelProvider
Return whether the label provider should decorate with the synchronization state.

Specified by:
isDecorationEnabled in class AbstractSynchronizeLabelProvider
Returns:
whether the label provider should decorate with the synchronization state

getImage

public Image getImage(Object element)
Description copied from interface: ILabelProvider
Returns the image for the label of the given element. The image is owned by the label provider and must not be disposed directly. Instead, dispose the label provider when no longer needed.

Specified by:
getImage in interface ILabelProvider
Overrides:
getImage in class AbstractSynchronizeLabelProvider

getModelRoot

protected Object getModelRoot()
Return the root object for the model. By default, it is the workspace root. Subclasses may override. This object is used to obtain an image for the model provider.

Returns:
the root object for the model

getText

public String getText(Object element)
Description copied from interface: ILabelProvider
Returns the text for the label of the given element.

Specified by:
getText in interface ILabelProvider
Overrides:
getText in class AbstractSynchronizeLabelProvider

getExtensionSite

public ICommonContentExtensionSite getExtensionSite()
Return the Common Navigator extension site for this label provider.

Returns:
the Common Navigator extension site for this label provider

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.