public abstract class AbstractSynchronizeLabelProvider extends Object implements ILabelProvider
| Constructor and Description |
|---|
AbstractSynchronizeLabelProvider() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(ILabelProviderListener listener)
Adds a listener to this label provider.
|
protected Image |
decorateImage(Image base,
Object element)
Decorate the image with the appropriate diff decorations.
|
protected String |
decorateText(String base,
Object element)
Decorate the text with the appropriate diff decorations.
|
void |
dispose()
Disposes of this label provider.
|
protected Image |
getDelegateImage(Object element)
Return the image for the item from the delegate label provider.
|
protected abstract ILabelProvider |
getDelegateLabelProvider()
Return the label provider that will return the text and image
appropriate for the given model element.
|
protected String |
getDelegateText(Object element)
Obtain the text for the object from the delegate label provider.
|
protected IDiff |
getDiff(Object element)
Return the sync kind of the given element.
|
Font |
getFont(Object element)
Method that provides a custom font for elements that are
busy.
|
Image |
getImage(Object element)
Returns the image for the label of the given element.
|
protected int |
getMarkerSeverity(Object element)
Return the marker severity (one of IMarker.SEVERITY_ERROR or
IMarker.SEVERITY_WARNING) to be overlayed on the given element or -1 if
there are no markers.
|
String |
getText(Object element)
Returns the text for the label of the given element.
|
protected boolean |
hasDecendantConflicts(Object element)
Return whether the given element has descendant conflicts.
|
protected boolean |
isBusy(Object element)
Return whether the given element is busy (i.e. is involved
in an operation.
|
protected abstract boolean |
isDecorationEnabled()
Return whether the label provider should decorate with the synchronization state.
|
protected boolean |
isIncludeOverlays()
Indicate whether the overlays provided by this class should be applied.
|
boolean |
isLabelProperty(Object element,
String property)
Returns whether the label would be affected
by a change to the given property of the given element.
|
protected boolean |
isSyncInfoInTextEnabled()
Returns whether the synchronization state should be included in the
text of the label.
|
void |
removeListener(ILabelProviderListener listener)
Removes a listener to this label provider.
|
public Image getImage(Object element)
ILabelProvidergetImage in interface ILabelProviderelement - the element for which to provide the label imagenull
if there is no image for the given objectprotected Image decorateImage(Image base, Object element)
CompareConfiguration.getImage(Image, int)
method to apply the decoration to the base image.base - the base image to be decorated.element - the elementgetDiff(Object),
CompareConfiguration.getImage(Image, int)protected Image getDelegateImage(Object element)
element - the elementpublic String getText(Object element)
ILabelProvidergetText in interface ILabelProviderelement - the element for which to provide the label textnull
if there is no text label for the given objectprotected String getDelegateText(Object element)
element - the elementprotected String decorateText(String base, Object element)
base - the base text to be decorated.element - the elementgetDiff(Object)public void addListener(ILabelProviderListener listener)
IBaseLabelProviderLabel provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.
addListener in interface IBaseLabelProviderlistener - a label provider listenerpublic void dispose()
IBaseLabelProviderdispose in interface IBaseLabelProviderpublic boolean isLabelProperty(Object element, String property)
IBaseLabelProviderisLabelProperty in interface IBaseLabelProviderelement - the elementproperty - the propertytrue if the label would be affected,
and false if it would be unaffectedpublic void removeListener(ILabelProviderListener listener)
IBaseLabelProviderremoveListener in interface IBaseLabelProviderlistener - a label provider listenerprotected boolean isSyncInfoInTextEnabled()
protected abstract ILabelProvider getDelegateLabelProvider()
protected abstract boolean isDecorationEnabled()
protected IDiff getDiff(Object element)
SyncInfo
class. A null is returned by default.element - the element being testedprotected boolean isIncludeOverlays()
false is returned. Subclasses may override
and control individual overlays by overriding the appropriate
query methods. Overlays provided by this class include problem marker
severity (getMarkerSeverity(Object)), propagated conflicts
(hasDecendantConflicts(Object) and busy state (isBusy(Object)).protected int getMarkerSeverity(Object element)
Although this class handles providing the overlays, it does not react to marker changes. Subclasses must issue label updates when the markers on a logical model element change.
element - the elementprotected boolean hasDecendantConflicts(Object element)
false is returned. Subclasses
may override.element - the elementprotected boolean isBusy(Object element)
false is returned.
Subclasses may override.element - the elementpublic Font getFont(Object element)
IFontProvider, subclasses that wish to get
busy indication using a font can do so.element - the elementGuidelines for using Eclipse APIs. Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.