|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.team.ui.synchronize.AbstractSynchronizeLabelProvider
A label provider wrapper that adds synchronization image and/or text decorations to the image and label obtained from the delegate provider.
Constructor Summary | |
---|---|
AbstractSynchronizeLabelProvider()
|
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AbstractSynchronizeLabelProvider()
Method Detail |
public Image getImage(Object element)
ILabelProvider
getImage
in interface ILabelProvider
element
- the element for which to provide the label image
null
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 element
getDiff(Object)
,
CompareConfiguration.getImage(Image, int)
protected Image getDelegateImage(Object element)
element
- the element
public String getText(Object element)
ILabelProvider
getText
in interface ILabelProvider
element
- the element for which to provide the label text
null
if there is no text label for the given objectprotected String getDelegateText(Object element)
element
- the element
protected String decorateText(String base, Object element)
base
- the base text to be decorated.element
- the element
getDiff(Object)
public void addListener(ILabelProviderListener listener)
IBaseLabelProvider
Label provider listeners are informed about state changes that affect the rendering of the viewer that uses this label provider.
addListener
in interface IBaseLabelProvider
listener
- a label provider listenerpublic void dispose()
IBaseLabelProvider
dispose
in interface IBaseLabelProvider
public boolean isLabelProperty(Object element, String property)
IBaseLabelProvider
isLabelProperty
in interface IBaseLabelProvider
element
- the elementproperty
- the property
true
if the label would be affected,
and false
if it would be unaffectedpublic void removeListener(ILabelProviderListener listener)
IBaseLabelProvider
removeListener
in interface IBaseLabelProvider
listener
- 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 tested
protected 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 element
protected boolean hasDecendantConflicts(Object element)
false
is returned. Subclasses
may override.
element
- the element
protected boolean isBusy(Object element)
false
is returned.
Subclasses may override.
element
- the element
public Font getFont(Object element)
IFontProvider
, subclasses that wish to get
busy indication using a font can do so.
element
- the element
|
Eclipse Platform Release 3.3 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.