final StringBuffer buffer = new StringBuffer();
int maxNumberOfLines = Math.round((float) maxHeight
/ (float) gc.getFontMetrics().getHeight());
fCounter = 0;
final LineBreakingReader reader = new LineBreakingReader(createReader(
hoverInfo, presentation), gc, maxWidth);
boolean lastLineFormatted = false;
String lastLineIndent = null;
String line = reader.readLine();
boolean lineFormatted = reader.isFormattedLine();
boolean firstLineProcessed = false;
while (line != null) {
if (fEnforceUpperLineLimit && maxNumberOfLines <= 0) {
break;
}
if (firstLineProcessed) {
if (!lastLineFormatted) {
append(buffer, LINE_DELIM, null);
} else {
append(buffer, LINE_DELIM, presentation);
if (lastLineIndent != null) {
append(buffer, lastLineIndent, presentation);
}
}
}
append(buffer, line, null);
firstLineProcessed = true;
lastLineFormatted = lineFormatted;
if (!lineFormatted) {
lastLineIndent = null;
} else if (lastLineIndent == null) {
lastLineIndent = getIndent(line);
}
line = reader.readLine();
lineFormatted = reader.isFormattedLine();
maxNumberOfLines--;
}
if (line != null) {