@Override public String decorateText(String text, Object element) { for (int i = 0; i < decorators.length; i++) { ILabelDecorator decorator = decorators[i]; String newText = decorator.decorateText(text, element); if (newText != null) { text = newText; } } return text; }
private String decorate(String text, Object obj) { String dec = decorator.decorateText(text, obj); if (dec != null) return dec; return text; }
public String decorateText(String text, Object element) { for (int i = 0; i < decorators.length; i++) { ILabelDecorator decorator = decorators[i]; String newText = decorator.decorateText(text, element); if (newText != null) { text = newText; } } return text; }
private String decorate(String string, StatusAdapter adapter) { messageDecorator = (ILabelDecorator) dialogState .get(IStatusDialogConstants.DECORATOR); if (messageDecorator != null) { string = messageDecorator.decorateText(string, adapter); } return string; }
protected String decorateText(String text, Object element) { if (fLabelDecorators != null && text.length() > 0) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= fLabelDecorators.get(i); String decorated= decorator.decorateText(text, element); if (decorated != null) { text= decorated; } } } return text; }
/** * Decorates and returns this rendering's label. * * @param label base label * @return decorated label * @since 3.2 */ protected String decorateLabel(String label) { if (fLabelDecorator != null) { return fLabelDecorator.decorateText(label.toString(), this); } return label.toString(); }
protected String decorateText(String text, Object element) { if (fLabelDecorators != null && text.length() > 0) { for (int i= 0; i < fLabelDecorators.size(); i++) { ILabelDecorator decorator= fLabelDecorators.get(i); String decorated= decorator.decorateText(text, element); if (decorated != null) { text= decorated; } } } return text; }
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); text = decorator.decorateText(text, element); } } return text; }
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; } } } return text; }
/** * @see BaseLabelProvider#getText(Object) */ public String getText(Object element) { if (element instanceof ServerTreeContentProvider.TreeElement) { return ((ServerTreeContentProvider.TreeElement) element).text; } String text = getTextImpl(element); if (decorator != null) { String dec = decorator.decorateText(text, element); if (dec != null && !dec.equals("")) return dec; } return text; }
/** * Decorate the label for the specified <code>IMemoryBlock</code> * * @param memBlk * @param label * @return the decorated label for the specified <code>IMemoryBlock</code> */ private String decorateLabel(final IMemoryBlock memBlk, String label) { ILabelDecorator decorator = memBlk.getAdapter(ILabelDecorator.class); if (decorator != null) { label = decorator.decorateText(label, memBlk); } return label; }
/** * Decorate the text provided for the element type. * This method should not be called unless a check for * isEnabled() has been done first. * Return null if there is no text or if there is an exception. */ String decorateText(String text, Object element) { try { //Internal decorator might be null so be prepared ILabelDecorator currentDecorator = internalGetDecorator(); if (currentDecorator != null) { return currentDecorator.decorateText(text, element); } } catch (CoreException exception) { handleCoreException(exception); } return null; }
private String getText(Object element) { if (element instanceof ItemsListSeparator) { return getSeparatorLabel(((ItemsListSeparator) element).getName()); } String str = provider.getText(element); if (selectionDecorator != null && isSelected(element)) { return selectionDecorator.decorateText(str.toString(), element); } return str; }
/** * The <code>DecoratingLabelProvider</code> implementation of this * <code>ILabelProvider</code> method returns the text label provided * by the nested label provider's <code>getText</code> method, * decorated with the decoration provided by the label decorator's * <code>decorateText</code> method. */ public String getText(Object element) { String text = provider.getText(element); if (decorator != null) { if (decorator instanceof LabelDecorator) { LabelDecorator ld2 = (LabelDecorator) decorator; String decorated = ld2.decorateText(text, element, getDecorationContext()); if (decorated != null) { return decorated; } } else { String decorated = decorator.decorateText(text, element); if (decorated != null) { return decorated; } } } return text; }
private StyledString getStyledText(Object element, IStyledLabelProvider provider) { StyledString string = provider.getStyledText(element); if (selectionDecorator != null && isSelected(element)) { String decorated = selectionDecorator.decorateText(string.getString(), element); return StyledCellLabelProvider.styleDecoratedString(decorated, null, string); // no need to add colors when element is selected } return string; }
/** * The <code>DecoratingLabelProvider</code> implementation of this * <code>ILabelProvider</code> method returns the text label provided * by the nested label provider's <code>getText</code> method, * decorated with the decoration provided by the label decorator's * <code>decorateText</code> method. */ @Override public String getText(Object element) { String text = provider.getText(element); if (decorator != null) { if (decorator instanceof LabelDecorator) { LabelDecorator ld2 = (LabelDecorator) decorator; String decorated = ld2.decorateText(text, element, getDecorationContext()); if (decorated != null) { return decorated; } } else { String decorated = decorator.decorateText(text, element); if (decorated != null) { return decorated; } } } return text; }
/** * @see ITableLabelProvider#getColumnText(Object, int) */ public String getColumnText(Object element, int columnIndex) { IRuntime runtime = (IRuntime) element; if (columnIndex == 0) { String text = notNull(runtime.getName()); if (decorator != null) { String dec = decorator.decorateText(text, element); if (dec != null) return dec; } return text; } else if (columnIndex == 1) { IRuntimeType runtimeType = runtime.getRuntimeType(); if (runtimeType != null) return notNull(runtimeType.getName()); return ""; } else return ""; }
public String getColumnText(Object element, int columnIndex) { if (element instanceof ServerTreeContentProvider.TreeElement) { if (columnIndex == 0) return ((ServerTreeContentProvider.TreeElement) element).text; return ""; } IRuntime runtime = (IRuntime) element; if (columnIndex == 0) { String text = notNull(runtime.getName()); if (decorator != null) { String dec = decorator.decorateText(text, runtime); if (dec != null) return dec; } return text; } else if (columnIndex == 1) { if (runtime.getRuntimeType() != null) return notNull(runtime.getRuntimeType().getName()); return ""; } return ""; } }
/** * 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); }