Menu

#49 Incorrect optimal width in TextCellRenderer

open
nobody
None
5
2009-02-20
2009-02-20
Anonymous
No

TextCellRenderer calculats optimal width without applying font and format.

The getOptimalWidth() method should be something like

applyFont(gc);

String text = null;
if (format != null) {
try {
text = format.format(content);
} catch (Exception e) {
logger.warn("Error formating cell content:{} with {}", content, format);
}
}

int width = super.getOptimalWidth(gc, col, row, text == null ? content.toString() : text, fixed, model);
resetFont(gc);
return width;

Discussion


Log in to post a comment.

MongoDB Logo MongoDB