Example usage for org.eclipse.jface.viewers ILabelDecorator decorateText

List of usage examples for org.eclipse.jface.viewers ILabelDecorator decorateText

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers ILabelDecorator decorateText.

Prototype

public String decorateText(String text, Object element);

Source Link

Document

Returns a text label that is based on the given text label, but decorated with additional information relating to the state of the provided element.

Usage

From source file:org.eclipse.wst.jsdt.internal.ui.viewsupport.JavaUILabelProvider.java

License:Open Source License

protected String decorateText(String text, Object element) {
    if (fLabelDecorators != null && text.length() > 0) {
        for (int i = 0; i < fLabelDecorators.size(); i++) {
            ILabelDecorator decorator = (ILabelDecorator) fLabelDecorators.get(i);
            String decorated = decorator.decorateText(text, element);
            if (decorated != null) {
                text = decorated;/*  w  w  w .j a  va2s.com*/
            }
        }
    }
    return text;
}

From source file:org.erlide.ui.editors.erl.outline.ErlangLabelProvider.java

License:Open Source License

protected String decorateText(String text, final Object element) {
    if (fLabelDecorators != null && text.length() > 0) {
        for (int i = 0; i < fLabelDecorators.size(); i++) {
            final ILabelDecorator decorator = fLabelDecorators.get(i);
            text = decorator.decorateText(text, element);
        }//from  w w w.ja  va  2  s  .  co  m
    }
    return text;
}

From source file:org.springframework.ide.eclipse.aop.ui.matcher.internal.WrappingBeansAndJavaModelLabelProvider.java

License:Open Source License

protected String decorateText(String text, Object element) {
    if (labelDecorators != null && text.length() > 0) {
        for (ILabelDecorator decorator : labelDecorators) {
            String decorated = decorator.decorateText(text, element);
            if (decorated != null) {
                text = decorated;//from   w ww  .ja  v  a  2 s.c  om
            }
        }
    }
    return text;
}