Search in sources :

Example 1 with IWorkbenchAdapter3

use of org.eclipse.ui.model.IWorkbenchAdapter3 in project translationstudio8 by heartsome.

the class WorkbenchLabelProvider method getStyledText.

/**
	 * The default implementation of this returns the styled text label for the given element.
	 * @param element
	 *            the element to evaluate the styled string for
	 * @return the styled string.
	 * @since 3.7
	 */
public StyledString getStyledText(Object element) {
    IWorkbenchAdapter3 adapter = getAdapter3(element);
    if (adapter == null) {
        // here.
        return new StyledString(getText(element));
    }
    StyledString styledString = adapter.getStyledText(element);
    // Now, re-use any existing decorateText implementation, to decorate
    // this styledString.
    String decorated = decorateText(styledString.getString(), element);
    Styler styler = getDecorationStyle(element);
    return StyledCellLabelProvider.styleDecoratedString(decorated, styler, styledString);
}
Also used : StyledString(org.eclipse.jface.viewers.StyledString) StyledString(org.eclipse.jface.viewers.StyledString) Styler(org.eclipse.jface.viewers.StyledString.Styler) IWorkbenchAdapter3(org.eclipse.ui.model.IWorkbenchAdapter3)

Aggregations

StyledString (org.eclipse.jface.viewers.StyledString)1 Styler (org.eclipse.jface.viewers.StyledString.Styler)1 IWorkbenchAdapter3 (org.eclipse.ui.model.IWorkbenchAdapter3)1