Eclipse Platform
Release 3.0

org.eclipse.ui
Interface IDecoratorManager


public interface IDecoratorManager

Manages the decorators contributed via the decorators extension point. Views which allow decoration of their elements should use the label decorator returned by getLabelDecorator().This class is not intended to be implemented by clients.


Method Summary
 IBaseLabelProvider getBaseLabelProvider(String decoratorId)
          Return the IBaseLabelProvider that corresponds to the decoratorId.
 boolean getEnabled(String decoratorId)
          Returns whether the specified decorator is enabled.
 ILabelDecorator getLabelDecorator()
          Returns the label decorator which applies the decorations from all enabled decorators.
 ILabelDecorator getLabelDecorator(String decoratorId)
          Returns the full label decorator instance for the specified decorator id if it is enabled.
 ILightweightLabelDecorator getLightweightLabelDecorator(String decoratorId)
          Deprecated. use getBaseLabelProvider(String) instead.
 void setEnabled(String decoratorId, boolean enabled)
          Sets whether the specified decorator is enabled.
 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.
 

Method Detail

getLabelDecorator

public 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.

Returns:
the label decorator
See Also:
DecoratingLabelProvider

getBaseLabelProvider

public 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

public ILabelDecorator getLabelDecorator(String decoratorId)
Returns the full label decorator instance for the specified decorator id if it is enabled. Otherwise returns null. Returns null for 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

public 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 returns null. Returns null for heavyweight decorators. Use getLabelDecorator instead for heavyweight decorators.

Parameters:
decoratorId - the decorator id
Returns:
the lightweight label decorator

getEnabled

public boolean getEnabled(String decoratorId)
Returns whether the specified decorator is enabled.

Parameters:
decoratorId - the decorator id
Returns:
true if the decorator is enabled, or false if not

setEnabled

public void setEnabled(String decoratorId,
                       boolean enabled)
                throws CoreException
Sets whether the specified decorator is enabled.

Parameters:
decoratorId - the decorator id
enabled - true to enable the decorator, or false to disable it
Throws:
CoreException - if the decorator cannot be instantiated

update

public 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

Eclipse Platform
Release 3.0

Guidelines for using Eclipse APIs.

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