String doclab = "<td><b>" + escapeXML(doc.getTitle()) + "</b> </td>\n";
String doclabDimmed = "<td class='dimmed'>" + escapeXML(doc.getTitle()) + "</td>\n";
Concordance conc = map.get(doc);
int counter = 0;
for (Iterator<ConcordanceLine> iter = conc.iterator(); iter.hasNext();) {
ConcordanceLine line = iter.next();
if (counter > 0)
sb.append(doclabDimmed);
else
sb.append(doclab);
counter++;
TokenList lhs = line.getLeftHandSide();
sb.append("<td class='right'>");
for (Iterator<Token> iterator = lhs.iterator(); iterator.hasNext();) {
Token word = iterator.next();
sb.append(escapeXML(word.getText()) + " ");
}
sb.append("</td><td><b>");
sb.append(escapeXML(line.getTarget().getText()));
TokenList rhs = line.getRightHandSide();
sb.append("</b>");
for (Iterator<Token> iterator = rhs.iterator(); iterator.hasNext();) {
Token word = iterator.next();
sb.append(" " + escapeXML(word.getText()));
}