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

  Nested Classes
  Modifier and Type
  Class
  Description
  `protected static enum`
  `ProblemLabelDecorator.Severity`
  Indicates problem severity.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ProblemLabelDecorator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `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)`
  `String`
  `decorateText(String text, Object element)`
  `String`
  `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)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 class `org.eclipse.jface.viewers.LabelDecorator`

  - ### decorateImage

    public org.eclipse.swt.graphics.Image decorateImage(org.eclipse.swt.graphics.Image image, Object element)
    Specified by:
      `decorateImage` in interface `org.eclipse.jface.viewers.ILabelDecorator`

  - ### decorateText

    public String decorateText(String text, Object element, org.eclipse.jface.viewers.IDecorationContext context)
    Specified by:
      `decorateText` in class `org.eclipse.jface.viewers.LabelDecorator`

  - ### decorateText

    public String decorateText(String text, Object element)
    Specified by:
      `decorateText` in interface `org.eclipse.jface.viewers.ILabelDecorator`

  - ### prepareDecoration

    public boolean prepareDecoration(Object element, String originalText, org.eclipse.jface.viewers.IDecorationContext context)
    Specified by:
      `prepareDecoration` in class `org.eclipse.jface.viewers.LabelDecorator`

  - ### dispose

    public void dispose()
    Specified by:
      `dispose` in interface `org.eclipse.jface.viewers.IBaseLabelProvider`

  - ### isLabelProperty

    public boolean isLabelProperty(Object element, String property)
    Specified by:
      `isLabelProperty` in interface `org.eclipse.jface.viewers.IBaseLabelProvider`

  - ### addListener

    public void addListener(org.eclipse.jface.viewers.ILabelProviderListener listener)
    Specified by:
      `addListener` in interface `org.eclipse.jface.viewers.IBaseLabelProvider`

  - ### removeListener

    public void removeListener(org.eclipse.jface.viewers.ILabelProviderListener listener)
    Specified by:
      `removeListener` in interface `org.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` - never `null`
      `context` - never `null`
    Returns:
      problem severity, or `null` if there is no problem