public class ProblemMarkerLabelDecorator extends ProblemLabelDecorator
IMarker.PROBLEM
.
Note that this decorator does not listen to problem marker changes. Hence, a viewer using this decorator requires a separate listener for updating elements on problem changes.
ProblemLabelDecorator.Severity
Constructor and Description |
---|
ProblemMarkerLabelDecorator() |
Modifier and Type | Method and Description |
---|---|
protected ProblemLabelDecorator.Severity |
computeProblemSeverity(java.lang.Object element,
org.eclipse.jface.viewers.IDecorationContext context)
Computes problem severity for the given element taking into account
the provided context.
|
protected ProblemLabelDecorator.Severity |
computeProblemSeverityFromMarkers(java.lang.Object element,
org.eclipse.jface.viewers.IDecorationContext context)
Computes problem severity for the given element from markers attached
to the element's underlying resource.
|
protected static ProblemLabelDecorator.Severity |
findMaxProblemSeverity(org.eclipse.core.resources.IResource resource,
int depth,
TextRange textRange)
Returns the maximum severity across problem markers attached to
the given resource, and, optionally, to its descendants.
|
protected IContentAdapter |
getContentAdapter(org.eclipse.jface.viewers.IDecorationContext context)
Returns the content adapter that defines a mapping between elements
of a Handly based model and the viewer's content.
|
addListener, decorateImage, decorateImage, decorateText, decorateText, dispose, isLabelProperty, prepareDecoration, removeListener
protected ProblemLabelDecorator.Severity computeProblemSeverity(java.lang.Object element, org.eclipse.jface.viewers.IDecorationContext context)
ProblemLabelDecorator
computeProblemSeverity
in class ProblemLabelDecorator
element
- never null
context
- never null
null
if there is no problemprotected ProblemLabelDecorator.Severity computeProblemSeverityFromMarkers(java.lang.Object element, org.eclipse.jface.viewers.IDecorationContext context) throws org.eclipse.core.runtime.CoreException
element
- never null
context
- never null
null
if there is no problemorg.eclipse.core.runtime.CoreException
protected IContentAdapter getContentAdapter(org.eclipse.jface.viewers.IDecorationContext context)
Default implementation requests the content adapter from the
IContentAdapterProvider
registered in the decoration context
under the name IContentAdapterProvider.class.getName()
.
If no provider is available, a NullContentAdapter
is returned.
context
- never null
IContentAdapter
(never null
)protected static ProblemLabelDecorator.Severity findMaxProblemSeverity(org.eclipse.core.resources.IResource resource, int depth, TextRange textRange) throws org.eclipse.core.runtime.CoreException
textRange
is not null
, only markers
strictly covered by the given text range are considered.
Returns null
if there are no matching markers.resource
- not null
depth
- how far to recurse (see IResource.DEPTH_*
)textRange
- the text range to further constrain the marker set,
or null
. Makes sense only if the given resource is
a text filenull
org.eclipse.core.runtime.CoreException