/** * Returns the styled text for the label of the given element. * * @param element * the element for which to provide the styled label text * @return the styled text string used to label the element */ @Override protected StyledString getStyledText(Object element) { StyledString styledString = super.getStyledText(element); if (this.decorator == null) { return styledString; } String label = styledString.getString(); String decorated; if (this.decorator instanceof LabelDecorator) { decorated = ((LabelDecorator) this.decorator).decorateText(label, element, getDecorationContext()); } else { decorated = this.decorator.decorateText(label, element); } if (decorated == null) return styledString; Styler style = getDecorationStyle(element); return StyledCellLabelProvider.styleDecoratedString(decorated, style, styledString); }
/** * Returns the styled text for the label of the given element. * * @param element * the element for which to provide the styled label text * @return the styled text string used to label the element */ @Override protected StyledString getStyledText(Object element) { StyledString styledString = super.getStyledText(element); if (this.decorator == null) { return styledString; } String label = styledString.getString(); String decorated; if (this.decorator instanceof LabelDecorator) { decorated = ((LabelDecorator) this.decorator).decorateText(label, element, getDecorationContext()); } else { decorated = this.decorator.decorateText(label, element); } if (decorated == null) return styledString; Styler style = getDecorationStyle(element); return StyledCellLabelProvider.styleDecoratedString(decorated, style, styledString); }