cell.setSortValue(MessageText.getString(key, column.getName()));
}
// @see org.gudy.azureus2.ui.swt.views.table.TableCellSWTPaintListener#cellPaint(org.eclipse.swt.graphics.GC, org.gudy.azureus2.ui.swt.views.table.TableCellSWT)
public void cellPaint(GC gc, TableCellSWT cell) {
TableColumnCore column = (TableColumnCore) cell.getDataSource();
String key = column.getTitleLanguageKey();
Rectangle bounds = cell.getBounds();
if (bounds == null || bounds.isEmpty()) {
return;
}
Font fontDefault = gc.getFont();
if (fontHeader == null) {
FontData[] fontData = gc.getFont().getFontData();
fontData[0].setStyle(SWT.BOLD);
fontData[0].setHeight(fontData[0].getHeight() + 1);
fontHeader = new Font(gc.getDevice(), fontData);
}
gc.setFont(fontHeader);
bounds.y += 3;
bounds.x += 7;
bounds.width -= 14;
String name = MessageText.getString(key, column.getName());
GCStringPrinter sp = new GCStringPrinter(gc, name, bounds, GCStringPrinter.FLAG_SKIPCLIP, SWT.TOP);
sp.printString();
Point titleSize = sp.getCalculatedSize();
gc.setFont(fontDefault);
String info = MessageText.getString(key + ".info", "");
Rectangle infoBounds = new Rectangle(bounds.x + 10, bounds.y + titleSize.y
+ 5, bounds.width - 15, bounds.height - 20);
GCStringPrinter.printString(gc, info, infoBounds, true, false);
TableColumnInfo columnInfo = (TableColumnInfo) cell.getTableRow().getData(
"columninfo");
if (columnInfo == null) {
final TableColumnManager tcm = TableColumnManager.getInstance();
columnInfo = tcm.getColumnInfo(column.getForDataSourceType(),
column.getTableID(), column.getName());
cell.getTableRowCore().setData("columninfo", columnInfo);
}
Rectangle profBounds = new Rectangle(bounds.width - 100, bounds.y - 2, 100, 20);
byte proficiency = columnInfo.getProficiency();
if (proficiency > 0 && proficiency < profText.length) {