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

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

Introduction

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

Prototype

public boolean hasNewFont() 

Source Link

Document

Return whether or not the font 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   www  . j  a v a 2s.co 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.
 * /*  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  . j a  v  a2  s .  c  om*/
 * @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());
    }

}