if (viewRow.isFailed()) {
row.append(new ColouredString(rowColour, viewRow.toString()));
return row;
}
MultiColourString gridRow = new MultiColourString();
boolean firstColumn = true;
for (int i = 0; i < l; i++) {
String currentColumn = columns.get(i);
ColourPair columnColour = rowColour;
if (highlightResults != null) {
ColourPair newPair = highlightResults.getColumnHighlight(currentColumn);
if (newPair != null) {
columnColour = newPair;
}
}
int itemWidth = widths.get(i);
if (itemWidth > 0) {
if (!firstColumn) {
gridRow.append(seperator);
} else {
firstColumn = false;
}
Object value = viewRow.getValue(currentColumn);
String display = formats.get(i).format(value);
if (display == null) {
display = "";
}
MultiColourString msc = applyHighlights(display, columnColour, highlightResults);
if (i == l - 1) {
gridRow.append(msc);
} else {
gridRow.append(fixedWidth(msc, itemWidth, rowColour));
}
}
}
row.appendColouredLines(wrappingMode.wrap(gridRow, screenWidth));
if (additional != null) {
String value = (String) viewRow.getValue(additional);
if (value != null && value.length() > 0) {
row.newLine();
MultiColourString colouredValue = new MultiColourString(rowColour, value);
row.appendColouredLines(wrappingMode.wrap(colouredValue, screenWidth));
}
}
return row;