Package org.eclipse.jface.viewers
Class FocusCellOwnerDrawHighlighter
java.lang.Object
org.eclipse.jface.viewers.FocusCellHighlighter
org.eclipse.jface.viewers.FocusCellOwnerDrawHighlighter
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
This class can be subclassed to configure how the coloring of the selected
cell.- Since:
- 3.3
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a new instance which can be passed to aTreeViewerFocusCellManagerFocusCellOwnerDrawHighlighter(ColumnViewer viewer, boolean removeNonFocusedSelectionInformation) Create a new instance which can be passed to aTreeViewerFocusCellManager -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfocusCellChanged(ViewerCell newCell, ViewerCell oldCell) Called by the framework when the focus cell has changed.protected ColorThe color to use when rendering the background of the selected cell when the control has the input focusprotected ColorThe color to use when rendering the background of the selected cell when the control has no input focusprotected ColorThe color to use when rendering the foreground (=text) of the selected cell when the control has the input focusprotected ColorThe color to use when rendering the foreground (=text) of the selected cell when the control has no input focusprotected booleanControls whether the whole cell or only the text-area is highlightedMethods inherited from class org.eclipse.jface.viewers.FocusCellHighlighter
focusCellChanged, getFocusCell, init
-
Constructor Details
-
FocusCellOwnerDrawHighlighter
Create a new instance which can be passed to aTreeViewerFocusCellManager- Parameters:
viewer- the viewer
-
FocusCellOwnerDrawHighlighter
public FocusCellOwnerDrawHighlighter(ColumnViewer viewer, boolean removeNonFocusedSelectionInformation) Create a new instance which can be passed to aTreeViewerFocusCellManager- Parameters:
viewer- the viewerremoveNonFocusedSelectionInformation-trueif only the currently focused cell should be indicated as selected.falseto indicate both the full selection and the currently focused cell.- Since:
- 3.14
-
-
Method Details
-
getSelectedCellBackgroundColor
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
nullto use the default
-
getSelectedCellForegroundColor
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
nullto use the default
-
getSelectedCellForegroundColorNoFocus
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
nullto use the same used when control has focus - Since:
- 3.4
-
getSelectedCellBackgroundColorNoFocus
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
nullto use the same used when control has focus - Since:
- 3.4
-
onlyTextHighlighting
Controls whether the whole cell or only the text-area is highlighted- Parameters:
cell- the cell which is highlighted- Returns:
trueif only the text area should be highlighted- Since:
- 3.4
-
focusCellChanged
Description copied from class:FocusCellHighlighterCalled by the framework when the focus cell has changed. Subclasses may extend.The default implementation for this method calls focusCellChanged(ViewerCell). Subclasses should override this method rather than
FocusCellHighlighter.focusCellChanged(ViewerCell).- Overrides:
focusCellChangedin classFocusCellHighlighter- Parameters:
newCell- the new focus cell ornullif no new cell receives the focusoldCell- the old focus cell ornullif no cell has been focused before
-