Class ECPFocusCellDrawHighlighter


  • public class ECPFocusCellDrawHighlighter
    extends org.eclipse.jface.viewers.FocusCellHighlighter
    A concrete implementation of FocusCellHighlighter using by setting the control into owner draw mode and highlighting the currently selected cell. To make the use this class you should create the control with the SWT.FULL_SELECTION bit set

    RAP specific: despite its name that was taken as-is from JFace/RCP to ease single-sourcing, this class does not use custom drawing to highlight the focused cell.
    The focused cell is displayed using the selection colors of the system.

    This class can be subclassed to configure how the coloring of the selected cell.
    Since:
    1.2
    • Constructor Summary

      Constructors 
      Constructor Description
      ECPFocusCellDrawHighlighter​(org.eclipse.jface.viewers.ColumnViewer viewer)
      Create a new instance which can be passed to a.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void focusCellChanged​(org.eclipse.jface.viewers.ViewerCell newCell, org.eclipse.jface.viewers.ViewerCell oldCell)  
      protected org.eclipse.swt.graphics.Color getSelectedCellBackgroundColor​(org.eclipse.jface.viewers.ViewerCell cell)
      The color to use when rendering the background of the selected cell when the control has the input focus.
      protected org.eclipse.swt.graphics.Color getSelectedCellBackgroundColorNoFocus​(org.eclipse.jface.viewers.ViewerCell cell)
      The color to use when rendering the background of the selected cell when the control has no input focus.
      protected org.eclipse.swt.graphics.Color getSelectedCellForegroundColor​(org.eclipse.jface.viewers.ViewerCell cell)
      The color to use when rendering the foreground (=text) of the selected cell when the control has the input focus.
      protected org.eclipse.swt.graphics.Color getSelectedCellForegroundColorNoFocus​(org.eclipse.jface.viewers.ViewerCell cell)
      The color to use when rendering the foreground (=text) of the selected cell when the control has no input focus.
      protected void init()  
      protected boolean onlyTextHighlighting​(org.eclipse.jface.viewers.ViewerCell cell)
      Controls whether the whole cell or only the text-area is highlighted.
      • Methods inherited from class org.eclipse.jface.viewers.FocusCellHighlighter

        focusCellChanged, getFocusCell
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ECPFocusCellDrawHighlighter

        public ECPFocusCellDrawHighlighter​(org.eclipse.jface.viewers.ColumnViewer viewer)
        Create a new instance which can be passed to a.
        Parameters:
        viewer - the viewer
    • Method Detail

      • getSelectedCellBackgroundColor

        protected org.eclipse.swt.graphics.Color getSelectedCellBackgroundColor​(org.eclipse.jface.viewers.ViewerCell cell)
        The color to use when rendering the background of the selected cell when the control has the input focus.
        Parameters:
        cell - the cell which is colored
        Returns:
        the color or null to use the default
      • getSelectedCellForegroundColor

        protected org.eclipse.swt.graphics.Color getSelectedCellForegroundColor​(org.eclipse.jface.viewers.ViewerCell cell)
        The color to use when rendering the foreground (=text) of the selected cell when the control has the input focus.
        Parameters:
        cell - the cell which is colored
        Returns:
        the color or null to use the default
      • getSelectedCellForegroundColorNoFocus

        protected org.eclipse.swt.graphics.Color getSelectedCellForegroundColorNoFocus​(org.eclipse.jface.viewers.ViewerCell cell)
        The color to use when rendering the foreground (=text) of the selected cell when the control has no input focus.
        Parameters:
        cell - the cell which is colored
        Returns:
        the color or null to use the same used when control has focus
      • getSelectedCellBackgroundColorNoFocus

        protected org.eclipse.swt.graphics.Color getSelectedCellBackgroundColorNoFocus​(org.eclipse.jface.viewers.ViewerCell cell)
        The color to use when rendering the background of the selected cell when the control has no input focus.
        Parameters:
        cell - the cell which is colored
        Returns:
        the color or null to use the same used when control has focus
      • onlyTextHighlighting

        protected boolean onlyTextHighlighting​(org.eclipse.jface.viewers.ViewerCell cell)
        Controls whether the whole cell or only the text-area is highlighted.
        Parameters:
        cell - the cell which is highlighted
        Returns:
        true if only the text area should be highlighted
      • init

        protected void init()
        Overrides:
        init in class org.eclipse.jface.viewers.FocusCellHighlighter
      • focusCellChanged

        protected void focusCellChanged​(org.eclipse.jface.viewers.ViewerCell newCell,
                                        org.eclipse.jface.viewers.ViewerCell oldCell)
        Overrides:
        focusCellChanged in class org.eclipse.jface.viewers.FocusCellHighlighter