Class XViewerLabelProvider

  • All Implemented Interfaces:
    org.eclipse.jface.viewers.IBaseLabelProvider, org.eclipse.jface.viewers.ITableColorProvider, org.eclipse.jface.viewers.ITableLabelProvider, IXViewerLabelProvider

    public abstract class XViewerLabelProvider
    extends java.lang.Object
    implements org.eclipse.jface.viewers.ITableLabelProvider, org.eclipse.jface.viewers.ITableColorProvider, IXViewerLabelProvider
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void clearXViewerColumnIndexCache()
      When columns get re-ordered, need to clear out this cache so indexing can be re-computed
      org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element, int columnIndex)  
      org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element, XViewerColumn xCol, int columnIndex)  
      java.lang.Object getBackingData​(java.lang.Object element, XViewerColumn xViewerColumn, int columnIndex)
      Returns the backing data object for operations like sorting
      int getColumnGradient​(java.lang.Object element, XViewerColumn xCol, int columnIndex)
      Return value between 0..100 and cell will show bar graph shading that portion of the cell
      org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element, int columnIndex)  
      abstract org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element, XViewerColumn xCol, int columnIndex)  
      java.lang.String getColumnText​(java.lang.Object element, int columnIndex)
      Returns the label text for the given column of the given element.
      abstract java.lang.String getColumnText​(java.lang.Object element, XViewerColumn xCol, int columnIndex)
      Returns the label text for the given column of the given element.
      org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element, int columnIndex)  
      org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element, XViewerColumn xCol, int columnIndex)  
      org.eclipse.swt.graphics.Color getSearchBackground​(java.lang.Object element, int columnIndex)  
      XViewerColumn getTreeColumnOffIndex​(int columnIndex)
      Returns XViewerColumn of the given index
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.eclipse.jface.viewers.IBaseLabelProvider

        addListener, dispose, isLabelProperty, removeListener
    • Field Detail

      • viewer

        private final XViewer viewer
      • indexToXViewerColumnMap

        private final java.util.Map<java.lang.Integer,​XViewerColumn> indexToXViewerColumnMap
    • Constructor Detail

      • XViewerLabelProvider

        public XViewerLabelProvider​(XViewer viewer)
    • Method Detail

      • getColumnImage

        public org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element,
                                                             int columnIndex)
        Specified by:
        getColumnImage in interface org.eclipse.jface.viewers.ITableLabelProvider
      • getColumnText

        public java.lang.String getColumnText​(java.lang.Object element,
                                              int columnIndex)
        Description copied from interface: IXViewerLabelProvider
        Returns the label text for the given column of the given element.
        Specified by:
        getColumnText in interface org.eclipse.jface.viewers.ITableLabelProvider
        Specified by:
        getColumnText in interface IXViewerLabelProvider
      • getSearchBackground

        public org.eclipse.swt.graphics.Color getSearchBackground​(java.lang.Object element,
                                                                  int columnIndex)
      • getBackground

        public org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element,
                                                            int columnIndex)
        Specified by:
        getBackground in interface org.eclipse.jface.viewers.ITableColorProvider
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element,
                                                            int columnIndex)
        Specified by:
        getForeground in interface org.eclipse.jface.viewers.ITableColorProvider
      • getBackground

        public org.eclipse.swt.graphics.Color getBackground​(java.lang.Object element,
                                                            XViewerColumn xCol,
                                                            int columnIndex)
      • getForeground

        public org.eclipse.swt.graphics.Color getForeground​(java.lang.Object element,
                                                            XViewerColumn xCol,
                                                            int columnIndex)
      • getColumnImage

        public abstract org.eclipse.swt.graphics.Image getColumnImage​(java.lang.Object element,
                                                                      XViewerColumn xCol,
                                                                      int columnIndex)
                                                               throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getColumnText

        public abstract java.lang.String getColumnText​(java.lang.Object element,
                                                       XViewerColumn xCol,
                                                       int columnIndex)
                                                throws java.lang.Exception
        Description copied from interface: IXViewerLabelProvider
        Returns the label text for the given column of the given element.
        Specified by:
        getColumnText in interface IXViewerLabelProvider
        Throws:
        java.lang.Exception
      • getBackingData

        public java.lang.Object getBackingData​(java.lang.Object element,
                                               XViewerColumn xViewerColumn,
                                               int columnIndex)
                                        throws java.lang.Exception
        Returns the backing data object for operations like sorting
        Specified by:
        getBackingData in interface IXViewerLabelProvider
        Throws:
        java.lang.Exception
      • getColumnGradient

        public int getColumnGradient​(java.lang.Object element,
                                     XViewerColumn xCol,
                                     int columnIndex)
                              throws java.lang.Exception
        Return value between 0..100 and cell will show bar graph shading that portion of the cell
        Specified by:
        getColumnGradient in interface IXViewerLabelProvider
        Throws:
        java.lang.Exception