Package org.eclipse.jdt.ui
Class ProblemsLabelDecorator
- java.lang.Object
-
- org.eclipse.jdt.ui.ProblemsLabelDecorator
-
- All Implemented Interfaces:
IBaseLabelProvider,ILabelDecorator,ILightweightLabelDecorator
public class ProblemsLabelDecorator extends Object implements ILabelDecorator, ILightweightLabelDecorator
LabelDecorator that decorates an element's image with error and warning overlays that represent the severity of markers attached to the element's underlying resource. To see a problem decoration for a marker, the marker needs to be a subtype ofIMarker.PROBLEM.Important: Although this decorator implements ILightweightLabelDecorator, do not contribute this class as a decorator to the
org.eclipse.ui.decoratorsextension. Only use this class in your own views and label providers.- Since:
- 2.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classProblemsLabelDecorator.ProblemsLabelChangedEventThis is a specialLabelProviderChangedEventcarrying additional information whether the event origins from a maker change.
-
Constructor Summary
Constructors Constructor Description ProblemsLabelDecorator()Creates a newProblemsLabelDecorator.ProblemsLabelDecorator(org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry registry)Note: This constructor is for internal use only.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddListener(ILabelProviderListener listener)protected intcomputeAdornmentFlags(Object obj)Computes the adornment flags for the given element.voiddecorate(Object element, IDecoration decoration)ImagedecorateImage(Image image, Object obj)StringdecorateText(String text, Object element)voiddispose()protected booleanisInside(int pos, ISourceReference sourceElement)Tests if a position is inside the source range of an element.booleanisLabelProperty(Object element, String property)voidremoveListener(ILabelProviderListener listener)
-
-
-
Constructor Detail
-
ProblemsLabelDecorator
public ProblemsLabelDecorator()
Creates a newProblemsLabelDecorator.
-
ProblemsLabelDecorator
public ProblemsLabelDecorator(org.eclipse.jdt.internal.ui.viewsupport.ImageDescriptorRegistry registry)
Note: This constructor is for internal use only. Clients should not call this constructor.- Parameters:
registry- The registry to use ornullto use the Java plugin's image registry- Restriction:
- This constructor is not intended to be referenced by clients.
-
-
Method Detail
-
decorateText
public String decorateText(String text, Object element)
- Specified by:
decorateTextin interfaceILabelDecorator
-
decorateImage
public Image decorateImage(Image image, Object obj)
- Specified by:
decorateImagein interfaceILabelDecorator
-
computeAdornmentFlags
protected int computeAdornmentFlags(Object obj)
Computes the adornment flags for the given element.- Parameters:
obj- the element to compute the flags for- Returns:
- the adornment flags
-
isInside
protected boolean isInside(int pos, ISourceReference sourceElement) throws CoreExceptionTests if a position is inside the source range of an element.- Parameters:
pos- Position to be tested.sourceElement- Source element (must be a IJavaElement)- Returns:
- boolean Return
trueif position is located inside the source element. - Throws:
CoreException- Exception thrown if element range could not be accessed.- Since:
- 2.1
-
dispose
public void dispose()
- Specified by:
disposein interfaceIBaseLabelProvider
-
isLabelProperty
public boolean isLabelProperty(Object element, String property)
- Specified by:
isLabelPropertyin interfaceIBaseLabelProvider
-
addListener
public void addListener(ILabelProviderListener listener)
- Specified by:
addListenerin interfaceIBaseLabelProvider
-
removeListener
public void removeListener(ILabelProviderListener listener)
- Specified by:
removeListenerin interfaceIBaseLabelProvider
-
decorate
public void decorate(Object element, IDecoration decoration)
- Specified by:
decoratein interfaceILightweightLabelDecorator
-
-