Package org.eclipse.ui
Interface IDecoratorManager
-
- All Superinterfaces:
IBaseLabelProvider,IDelayedLabelDecorator,ILabelDecorator
public interface IDecoratorManager extends IDelayedLabelDecorator
Manages the decorators contributed via theorg.eclipse.ui.decoratorextension point. Views which allow decoration of their elements should use the label decorator returned bygetLabelDecorator().This class is not intended to be implemented by clients.
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IBaseLabelProvidergetBaseLabelProvider(String decoratorId)Return the IBaseLabelProvider that corresponds to the decoratorId.booleangetEnabled(String decoratorId)Returns whether the specified decorator is enabled.ILabelDecoratorgetLabelDecorator()Returns the label decorator which applies the decorations from all enabled decorators.ILabelDecoratorgetLabelDecorator(String decoratorId)Returns the full label decorator instance for the specified decorator id if it is enabled.ILightweightLabelDecoratorgetLightweightLabelDecorator(String decoratorId)Deprecated.use getBaseLabelProvider(String) instead.voidsetEnabled(String decoratorId, boolean enabled)Sets whether the specified decorator is enabled.voidupdate(String decoratorId)Fire a LabelProviderChangedEvent for the decorator that corresponds to decoratorID if it exists and is enabled using the IBaseLabelProvider as the argument to the event.-
Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider
addListener, dispose, isLabelProperty, removeListener
-
Methods inherited from interface org.eclipse.jface.viewers.IDelayedLabelDecorator
prepareDecoration
-
Methods inherited from interface org.eclipse.jface.viewers.ILabelDecorator
decorateImage, decorateText
-
-
-
-
Method Detail
-
getLabelDecorator
ILabelDecorator getLabelDecorator()
Returns the label decorator which applies the decorations from all enabled decorators. Views which allow decoration of their elements should use this label decorator. This decorator should be disposed when it is no longer referenced by the caller or the images created within it may be kept untilJFaceResources.getResources()is disposed.- Returns:
ILabelDecorator- See Also:
DecoratingLabelProvider,IBaseLabelProvider.dispose()
-
getBaseLabelProvider
IBaseLabelProvider getBaseLabelProvider(String decoratorId)
Return the IBaseLabelProvider that corresponds to the decoratorId. This can handle both lightweight and full decorators.- Parameters:
decoratorId- the decorator id- Returns:
- the label provider
-
getLabelDecorator
ILabelDecorator getLabelDecorator(String decoratorId)
Returns the full label decorator instance for the specified decorator id if it is enabled. Otherwise returnsnull. Returnsnullfor lightweight decorators. It is recommended that getBaseLabelProvider is used instead so that lightweight decorators are also checked.- Parameters:
decoratorId- the decorator id- Returns:
- the label decorator
-
getLightweightLabelDecorator
@Deprecated ILightweightLabelDecorator getLightweightLabelDecorator(String decoratorId)
Deprecated.use getBaseLabelProvider(String) instead.Returns the lightweight label decorator instance for the specified decorator id if it is enabled. Otherwise returnsnull. Returnsnullfor heavyweight decorators. UsegetLabelDecoratorinstead for heavyweight decorators.- Parameters:
decoratorId- the decorator id- Returns:
- the lightweight label decorator
-
getEnabled
boolean getEnabled(String decoratorId)
Returns whether the specified decorator is enabled.- Parameters:
decoratorId- the decorator id- Returns:
trueif the decorator is enabled, orfalseif not
-
setEnabled
void setEnabled(String decoratorId, boolean enabled) throws CoreException
Sets whether the specified decorator is enabled.- Parameters:
decoratorId- the decorator idenabled-trueto enable the decorator, orfalseto disable it- Throws:
CoreException- if the decorator cannot be instantiated
-
update
void update(String decoratorId)
Fire a LabelProviderChangedEvent for the decorator that corresponds to decoratorID if it exists and is enabled using the IBaseLabelProvider as the argument to the event. Otherwise do nothing.This method must be called from the user interface thread as widget updates may result.
- Parameters:
decoratorId- the decorator id
-
-