/** * Formats the source w/ syntax coloring etc. This implementation replaces tabs with spaces. * May be overridden by subclasses. * * @param content the hover content * @return <code>content</code> reformatted */ protected String formatSource(String content) { if (content != null) { StringBuilder sb= new StringBuilder(content); final String tabReplacement= getTabReplacement(); for (int pos= 0; pos < sb.length(); pos++) { if (sb.charAt(pos) == '\t') sb.replace(pos, pos + 1, tabReplacement); } return sb.toString(); } return content; }
/** * Formats the source w/ syntax coloring etc. This implementation replaces tabs with spaces. * May be overridden by subclasses. * * @param content the hover content * @return <code>content</code> reformatted */ protected String formatSource(String content) { if (content != null) { StringBuffer sb= new StringBuffer(content); final String tabReplacement= getTabReplacement(); for (int pos= 0; pos < sb.length(); pos++) { if (sb.charAt(pos) == '\t') sb.replace(pos, pos + 1, tabReplacement); } return sb.toString(); } return content; }