@Override public FlexibleBuffer append(String string) { fStyledString.append(string); return this; }
@Override public FlexibleBuffer append(String string) { fStyledString.append(string); return this; }
/** * Appends a string to the {@link StyledString}. The appended string * will have no associated styler. * * @param string * the string to append * @return returns a reference to this object */ public StyledString append(String string) { return append(string, null); }
/** * Appends a string to the {@link StyledString}. The appended string * will have no associated styler. * * @param string * the string to append * @return returns a reference to this object */ public StyledString append(String string) { return append(string, null); }
/** * Appends the string representation of the given character array * to the {@link StyledString}. The appended * character array will have no associated styler. * * @param chars * the character array to append * @return returns a reference to this object */ public StyledString append(char[] chars) { return append(chars, null); }
@Override public FlexibleBuffer append(char ch) { fStyledString.append(ch); return this; }
@Override public FlexibleBuffer append(char ch) { fStyledString.append(ch); return this; }
/** * Appends the string representation of the given character * to the {@link StyledString}. The appended * character will have no associated styler. * * @param ch * the character to append * @return returns a reference to this object */ public StyledString append(char ch) { return append(String.valueOf(ch), null); }
/** * Appends the string representation of the given character * to the {@link StyledString}. The appended * character will have no associated styler. * * @param ch * the character to append * @return returns a reference to this object */ public StyledString append(char ch) { return append(String.valueOf(ch), null); }
StyledString createTypeProposalLabel(char[] fullName) { // only display innermost type name as type name, using any // enclosing types as qualification int qIndex= findSimpleNameStart(fullName); StyledString buf= new StyledString(); buf.append(new String(fullName, qIndex, fullName.length - qIndex)); if (qIndex > 0) { buf.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER); buf.append(new String(fullName, 0, qIndex - 1), StyledString.QUALIFIER_STYLER); } return Strings.markJavaElementLabelLTR(buf); }
StyledString createTypeProposalLabel(char[] fullName) { // only display innermost type name as type name, using any // enclosing types as qualification int qIndex= findSimpleNameStart(fullName); StyledString buf= new StyledString(); buf.append(new String(fullName, qIndex, fullName.length - qIndex)); if (qIndex > 0) { buf.append(JavaElementLabels.CONCAT_STRING, StyledString.QUALIFIER_STYLER); buf.append(new String(fullName, 0, qIndex - 1), StyledString.QUALIFIER_STYLER); } return org.eclipse.jdt.internal.corext.util.Strings.markJavaElementLabelLTR(buf); }
private StyledString getColoredLabelWithCounts(Object element, StyledString coloredName) { AbstractTextSearchResult result= fPage.getInput(); if (result == null) return coloredName; int matchCount= result.getMatchCount(element); if (matchCount <= 1) return coloredName; String countInfo= Messages.format(SearchMessages.FileLabelProvider_count_format, Integer.valueOf(matchCount)); coloredName.append(' ').append(countInfo, StyledString.COUNTER_STYLER); return coloredName; }
StyledString createSimpleLabelWithType(CompletionProposal proposal) { StyledString buf= new StyledString(); buf.append(proposal.getCompletion()); char[] typeName= Signature.getSignatureSimpleName(proposal.getSignature()); if (typeName.length > 0) { buf.append(VAR_TYPE_SEPARATOR); buf.append(typeName); } return Strings.markJavaElementLabelLTR(buf); }
@Override public StyledString getStyledText(Object element) { StyledString styledString= getColoredLabelWithCounts(element, internalGetStyledText(element)); styledString.append(getQualification(element), StyledString.QUALIFIER_STYLER); return styledString; }
@Override public StyledString getStyledText(Object element) { StyledString text= super.getStyledText(element); String qualifier= getQualifier(element); if (qualifier != null) { StyledString styledString= new StyledString(qualifier); styledString.append(text); return styledString; } return text; }
@Override public StyledString getStyledText(Object element) { StyledString text= super.getStyledText(element); String qualifier= getQualifier(element); if (qualifier != null) { StyledString styledString= new StyledString(qualifier); styledString.append(text); return styledString; } return text; }
@Override public StyledString getStyledText(Object element) { StyledString styledString= getColoredLabelWithCounts(element, internalGetStyledText(element)); styledString.append(getQualification(element), StyledString.QUALIFIER_STYLER); return styledString; }
@Override public StyledString getStyledDisplayString(IDocument document, int offset, BoldStylerProvider boldStylerProvider) { StyledString styledDisplayString= new StyledString(); styledDisplayString.append(getStyledDisplayString()); int start= getPrefixCompletionStart(document, offset); int patternLength= offset - start; if (patternLength > 0) { styledDisplayString.setStyle(0, patternLength, boldStylerProvider.getBoldStyler()); } return styledDisplayString; }
public StyledString getStyledText(Object element) { String text = getText(element); if (text != null) { StyledString styledString = new StyledString(text); if (element instanceof ITestCase) { String duration = " " + DateUtil.getFormattedDurationShort(((ITestCase) element).getDuration(), true); styledString.append(duration, StyledString.DECORATIONS_STYLER); } return styledString; } return new StyledString(); }
private StyledString decorateLineMatches(MatchLine lineMatches) { String line = lineMatches.getLine(); StyledString str = new StyledString(line); for(Match m: lineMatches.getMatches()) { str.setStyle(m.getOffset(), m.getLength(), highlightStyle); } StyledString ret = new StyledString(); ret.append(lineMatches.getLineNumber() + ": ", StyledString.QUALIFIER_STYLER); ret.append(str); return ret; }