public class FocusCellOwnerDrawHighlighter extends FocusCellHighlighter
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
This class can be subclassed to configure how the coloring of the selected
cell.Constructor and Description |
---|
FocusCellOwnerDrawHighlighter(ColumnViewer viewer)
Create a new instance which can be passed to a
TreeViewerFocusCellManager |
Modifier and Type | Method and Description |
---|---|
protected void |
focusCellChanged(ViewerCell newCell,
ViewerCell oldCell)
Called by the framework when the focus cell has changed.
|
protected Color |
getSelectedCellBackgroundColor(ViewerCell cell)
The color to use when rendering the background of the selected cell when
the control has the input focus
|
protected Color |
getSelectedCellBackgroundColorNoFocus(ViewerCell cell)
The color to use when rendering the background of the selected cell when
the control has no input focus
|
protected Color |
getSelectedCellForegroundColor(ViewerCell cell)
The color to use when rendering the foreground (=text) of the selected
cell when the control has the input focus
|
protected Color |
getSelectedCellForegroundColorNoFocus(ViewerCell cell)
The color to use when rendering the foreground (=text) of the selected
cell when the control has no input focus
|
protected boolean |
onlyTextHighlighting(ViewerCell cell)
Controls whether the whole cell or only the text-area is highlighted
|
focusCellChanged, getFocusCell, init
public FocusCellOwnerDrawHighlighter(ColumnViewer viewer)
TreeViewerFocusCellManager
viewer
- the viewerprotected Color getSelectedCellBackgroundColor(ViewerCell cell)
cell
- the cell which is colorednull
to use the defaultprotected Color getSelectedCellForegroundColor(ViewerCell cell)
cell
- the cell which is colorednull
to use the defaultprotected Color getSelectedCellForegroundColorNoFocus(ViewerCell cell)
cell
- the cell which is colorednull
to use the same used when
control has focusprotected Color getSelectedCellBackgroundColorNoFocus(ViewerCell cell)
cell
- the cell which is colorednull
to use the same used when
control has focusprotected boolean onlyTextHighlighting(ViewerCell cell)
cell
- the cell which is highlightedtrue
if only the text area should be highlightedprotected void focusCellChanged(ViewerCell newCell, ViewerCell oldCell)
FocusCellHighlighter
The default implementation for this method calls
focusCellChanged(ViewerCell). Subclasses should override this method
rather than FocusCellHighlighter.focusCellChanged(ViewerCell)
.
focusCellChanged
in class FocusCellHighlighter
newCell
- the new focus cell or null
if no new cell
receives the focusoldCell
- the old focus cell or null
if no cell has been
focused before
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.