gc.setFont(getFont());
ensureBoldFontPresent(getFont());
gc.setForeground(getForeground());
gc.setBackground(getBackground());
Locator loc = new Locator();
loc.marginWidth = marginWidth;
loc.marginHeight = marginHeight;
loc.x = marginWidth;
loc.y = marginHeight;
FontMetrics fm = gc.getFontMetrics();
int lineHeight = fm.getHeight();
Paragraph[] paragraphs = model.getParagraphs();
IHyperlinkSegment selectedLink = getSelectedLink();
for (int i = 0; i < paragraphs.length; i++) {
Paragraph p = paragraphs[i];
if (i > 0 && paragraphsSeparated && p.getAddVerticalSpace())
loc.y += getParagraphSpacing(lineHeight);
loc.indent = p.getIndent();
loc.resetCaret();
loc.rowHeight = 0;
p.layout(gc, carea.width, loc, lineHeight, resourceTable,
selectedLink);
}
gc.dispose();