Example usage for org.eclipse.jface.viewers IDecoration setFont

List of usage examples for org.eclipse.jface.viewers IDecoration setFont

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers IDecoration setFont.

Prototype

void setFont(Font font);

Source Link

Document

Set the font for this decoration.

Usage

From source file:org.tigris.subversion.subclipse.ui.decorator.SVNLightweightDecorator.java

License:Open Source License

private void computeColorsAndFonts(boolean isIgnored, boolean isDirty, IDecoration decoration) {
    if (!SVNUIPlugin.getPlugin().getPreferenceStore().getBoolean(ISVNUIConstants.PREF_USE_FONT_DECORATORS))
        return;/*from  ww w.  j a v a 2 s  .  c  om*/
    ITheme current = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme();
    if (isIgnored) {
        decoration.setBackgroundColor(
                current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_BACKGROUND_COLOR));
        decoration.setForegroundColor(
                current.getColorRegistry().get(SVNDecoratorConfiguration.IGNORED_FOREGROUND_COLOR));
        decoration.setFont(current.getFontRegistry().get(SVNDecoratorConfiguration.IGNORED_FONT));
    } else if (isDirty) {
        decoration.setBackgroundColor(
                current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_BACKGROUND_COLOR));
        decoration.setForegroundColor(
                current.getColorRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FOREGROUND_COLOR));
        decoration.setFont(current.getFontRegistry().get(SVNDecoratorConfiguration.OUTGOING_CHANGE_FONT));
    }
}