Example usage for org.eclipse.jface.viewers CellLabelProvider getToolTipForegroundColor

List of usage examples for org.eclipse.jface.viewers CellLabelProvider getToolTipForegroundColor

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers CellLabelProvider getToolTipForegroundColor.

Prototype

public Color getToolTipForegroundColor(Object object) 

Source Link

Document

The foreground color used to display the the text in the tool tip

Usage

From source file:org.eclipse.e4mf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport.java

License:Open Source License

protected boolean shouldCreateToolTip(Event event) {
    ViewerCell cell = getToolTipArea(event);
    if (cell != null && !cell.equals(currentCell)) {
        control.setToolTipText("");
        currentCell = cell;// w ww  .  j  a v a2s .c  o m
        ViewerRow row = cell.getViewerRow();
        if (row != null) {
            Object element = row.getItem().getData();
            CellLabelProvider labelProvider = viewer.getLabelProvider(cell.getColumnIndex());
            text = labelProvider.getToolTipText(element);
            boolean useNative = labelProvider.useNativeToolTip(element);
            if (useNative || text == null) {
                control.setToolTipText(text);
            } else {
                foregroundColor = labelProvider.getToolTipForegroundColor(element);
                backgroundColor = labelProvider.getToolTipBackgroundColor(element);
                font = labelProvider.getToolTipFont(element);
                return text != null;
            }
        }
    } else {
        currentCell = cell;
    }

    return false;
}