Example usage for org.eclipse.jface.viewers ViewerLabel hasNewForeground

List of usage examples for org.eclipse.jface.viewers ViewerLabel hasNewForeground

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ViewerLabel hasNewForeground.

Prototype

public boolean hasNewForeground() 

Source Link

Document

Return whether or not the foreground color has been set.

Usage

From source file:org.neuro4j.studio.debug.ui.views.StructuredViewer.java

License:Apache License

/**
 * Build a label up for the element using the supplied label provider.
 * /*from  w  w  w  . ja  v a 2 s.  c o  m*/
 * @param updateLabel
 *        The ViewerLabel to collect the result in
 * @param element
 *        The element being decorated.
 */
protected void buildLabel(ViewerLabel updateLabel, Object element) {

    if (getLabelProvider() instanceof IViewerLabelProvider) {
        IViewerLabelProvider itemProvider = (IViewerLabelProvider) getLabelProvider();
        itemProvider.updateLabel(updateLabel, element);

        colorAndFontCollector.setUsedDecorators();

        if (updateLabel.hasNewBackground()) {
            colorAndFontCollector.setBackground(updateLabel.getBackground());
        }

        if (updateLabel.hasNewForeground()) {
            colorAndFontCollector.setForeground(updateLabel.getForeground());
        }

        if (updateLabel.hasNewFont()) {
            colorAndFontCollector.setFont(updateLabel.getFont());
        }
        return;

    }

    if (getLabelProvider() instanceof ILabelProvider) {
        ILabelProvider labelProvider = (ILabelProvider) getLabelProvider();
        updateLabel.setText(labelProvider.getText(element));
        updateLabel.setImage(labelProvider.getImage(element));
    }

}

From source file:org.neuro4j.studio.debug.ui.views.StructuredViewer.java

License:Apache License

/**
 * Build a label up for the element using the supplied label provider.
 * /*from  w  w  w  .j a va  2 s.  c  om*/
 * @param updateLabel
 *        The ViewerLabel to collect the result in
 * @param element
 *        The element being decorated.
 * @param labelProvider
 *        ILabelProvider the labelProvider for the receiver.
 */
void buildLabel(ViewerLabel updateLabel, Object element, IViewerLabelProvider labelProvider) {

    labelProvider.updateLabel(updateLabel, element);

    colorAndFontCollector.setUsedDecorators();

    if (updateLabel.hasNewBackground()) {
        colorAndFontCollector.setBackground(updateLabel.getBackground());
    }

    if (updateLabel.hasNewForeground()) {
        colorAndFontCollector.setForeground(updateLabel.getForeground());
    }

    if (updateLabel.hasNewFont()) {
        colorAndFontCollector.setFont(updateLabel.getFont());
    }

}

From source file:org.neuro4j.studio.debug.ui.views.StructuredViewer.java

License:Apache License

/**
 * Build a label up for the element using the supplied label provider.
 * // w w  w. jav a 2s . c o m
 * @param updateLabel
 *        The ViewerLabel to collect the result in
 * @param elementPath
 *        The path of the element being decorated.
 * @param labelProvider
 *        ILabelProvider the labelProvider for the receiver.
 */
void buildLabel(ViewerLabel updateLabel, TreePath elementPath, ITreePathLabelProvider labelProvider) {

    labelProvider.updateLabel(updateLabel, elementPath);

    colorAndFontCollector.setUsedDecorators();

    if (updateLabel.hasNewBackground()) {
        colorAndFontCollector.setBackground(updateLabel.getBackground());
    }

    if (updateLabel.hasNewForeground()) {
        colorAndFontCollector.setForeground(updateLabel.getForeground());
    }

    if (updateLabel.hasNewFont()) {
        colorAndFontCollector.setFont(updateLabel.getFont());
    }

}