Class 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 class  ProblemLabelDecorator.Severity
      Indicates problem severity.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(org.eclipse.jface.viewers.ILabelProviderListener listener)  
      protected abstract 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.
      org.eclipse.swt.graphics.Image decorateImage​(org.eclipse.swt.graphics.Image image, java.lang.Object element)  
      org.eclipse.swt.graphics.Image decorateImage​(org.eclipse.swt.graphics.Image image, java.lang.Object element, org.eclipse.jface.viewers.IDecorationContext context)  
      java.lang.String decorateText​(java.lang.String text, java.lang.Object element)  
      java.lang.String decorateText​(java.lang.String text, java.lang.Object element, org.eclipse.jface.viewers.IDecorationContext context)  
      void dispose()  
      boolean isLabelProperty​(java.lang.Object element, java.lang.String property)  
      boolean prepareDecoration​(java.lang.Object element, java.lang.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 Detail

      • ProblemLabelDecorator

        public ProblemLabelDecorator()
    • Method Detail

      • decorateImage

        public org.eclipse.swt.graphics.Image decorateImage​(org.eclipse.swt.graphics.Image image,
                                                            java.lang.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,
                                                            java.lang.Object element)
        Specified by:
        decorateImage in interface org.eclipse.jface.viewers.ILabelDecorator
      • decorateText

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

        public java.lang.String decorateText​(java.lang.String text,
                                             java.lang.Object element)
        Specified by:
        decorateText in interface org.eclipse.jface.viewers.ILabelDecorator
      • prepareDecoration

        public boolean prepareDecoration​(java.lang.Object element,
                                         java.lang.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​(java.lang.Object element,
                                       java.lang.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​(java.lang.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