if (prov instanceof ITableLabelProvider) {
tprov = (ITableLabelProvider) prov;
}
int columnCount = tableTree.getTable().getColumnCount();
TableTreeItem ti = (TableTreeItem) item;
// Also enter loop if no columns added. See 1G9WWGZ: JFUIF:WINNT -
// TableViewer with 0 columns does not work
for (int column = 0; column < columnCount || column == 0; column++) {
String text = "";//$NON-NLS-1$
Image image = null;
if (tprov != null) {
text = tprov.getColumnText(element, column);
image = tprov.getColumnImage(element, column);
} else {
if (column == 0) {
ViewerLabel updateLabel = new ViewerLabel(item.getText(),
item.getImage());
buildLabel(updateLabel, element);
// As it is possible for user code to run the event
// loop check here.
if (item.isDisposed()) {
unmapElement(element, item);
return;
}
text = updateLabel.getText();
image = updateLabel.getImage();
}
}
// Avoid setting text to null
if (text == null) {
text = ""; //$NON-NLS-1$
}
ti.setText(column, text);
// Apparently a problem to setImage to null if already null
if (ti.getImage(column) != image) {
ti.setImage(column, image);
}
getColorAndFontCollector().setFontsAndColors(element);
getColorAndFontCollector().applyFontsAndColors(ti);
}