Package org.eclipse.handly.ui.viewer
Class ProblemLabelDecorator
java.lang.Object
org.eclipse.jface.viewers.LabelDecorator
org.eclipse.handly.ui.viewer.ProblemLabelDecorator
- All Implemented Interfaces:
org.eclipse.jface.viewers.IBaseLabelProvider
,org.eclipse.jface.viewers.ILabelDecorator
- Direct Known Subclasses:
ProblemMarkerLabelDecorator
public abstract class ProblemLabelDecorator
extends org.eclipse.jface.viewers.LabelDecorator
implements org.eclipse.jface.viewers.ILabelDecorator
An abstract base class for decorating an element's image with error and
warning overlays. Subclasses must implement the
computeProblemSeverity
method.-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static enum
Indicates problem severity. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addListener
(org.eclipse.jface.viewers.ILabelProviderListener listener) protected abstract ProblemLabelDecorator.Severity
computeProblemSeverity
(Object element, org.eclipse.jface.viewers.IDecorationContext context) Computes problem severity for the given element taking into account the provided context.org.eclipse.swt.graphics.Image
decorateImage
(org.eclipse.swt.graphics.Image image, Object element) org.eclipse.swt.graphics.Image
decorateImage
(org.eclipse.swt.graphics.Image image, Object element, org.eclipse.jface.viewers.IDecorationContext context) decorateText
(String text, Object element) decorateText
(String text, Object element, org.eclipse.jface.viewers.IDecorationContext context) void
dispose()
boolean
isLabelProperty
(Object element, String property) boolean
prepareDecoration
(Object element, String originalText, org.eclipse.jface.viewers.IDecorationContext context) void
removeListener
(org.eclipse.jface.viewers.ILabelProviderListener listener)
-
Constructor Details
-
ProblemLabelDecorator
public ProblemLabelDecorator()
-
-
Method Details
-
decorateImage
public org.eclipse.swt.graphics.Image decorateImage(org.eclipse.swt.graphics.Image image, Object element, org.eclipse.jface.viewers.IDecorationContext context) - Specified by:
decorateImage
in classorg.eclipse.jface.viewers.LabelDecorator
-
decorateImage
public org.eclipse.swt.graphics.Image decorateImage(org.eclipse.swt.graphics.Image image, Object element) - Specified by:
decorateImage
in interfaceorg.eclipse.jface.viewers.ILabelDecorator
-
decorateText
public String decorateText(String text, Object element, org.eclipse.jface.viewers.IDecorationContext context) - Specified by:
decorateText
in classorg.eclipse.jface.viewers.LabelDecorator
-
decorateText
- Specified by:
decorateText
in interfaceorg.eclipse.jface.viewers.ILabelDecorator
-
prepareDecoration
public boolean prepareDecoration(Object element, String originalText, org.eclipse.jface.viewers.IDecorationContext context) - Specified by:
prepareDecoration
in classorg.eclipse.jface.viewers.LabelDecorator
-
dispose
public void dispose()- Specified by:
dispose
in interfaceorg.eclipse.jface.viewers.IBaseLabelProvider
-
isLabelProperty
- Specified by:
isLabelProperty
in interfaceorg.eclipse.jface.viewers.IBaseLabelProvider
-
addListener
public void addListener(org.eclipse.jface.viewers.ILabelProviderListener listener) - Specified by:
addListener
in interfaceorg.eclipse.jface.viewers.IBaseLabelProvider
-
removeListener
public void removeListener(org.eclipse.jface.viewers.ILabelProviderListener listener) - Specified by:
removeListener
in interfaceorg.eclipse.jface.viewers.IBaseLabelProvider
-
computeProblemSeverity
protected abstract ProblemLabelDecorator.Severity computeProblemSeverity(Object element, org.eclipse.jface.viewers.IDecorationContext context) Computes problem severity for the given element taking into account the provided context.- Parameters:
element
- nevernull
context
- nevernull
- Returns:
- problem severity, or
null
if there is no problem
-