}
addSeparator(doc, buffer);
for (Object id : fieldArr) {
ProgramFieldType type = null;
if (id instanceof String) {
if (((String) id).matches("\\d+")) {
try {
type = ProgramFieldType
.getTypeForId(Integer.parseInt((String) id, 10));
} catch (Exception e) {
// Empty Catch
}
}
if (type == null) {
int length = prog.getLength();
if (length > 0 && ((String) id).trim().length() > 0) {
buffer
.append("<tr><td valign=\"top\" style=\"color:gray; font-size:");
buffer.append(mBodyFontSize);
buffer.append("\"><b>");
buffer.append(mLocalizer.msg("duration",
"Program duration/<br>-end"));
buffer.append("</b></td><td style=\"color:rgb("+ foreground.getRed() + "," + foreground.getGreen() + "," + foreground.getBlue() + "); font-size:");
buffer.append(mBodyFontSize);
buffer.append("\">");
openPara(buffer, "time");
String msg = mLocalizer.msg("minutes", "{0} min", length);
buffer.append(msg).append(" (");
buffer.append(mLocalizer.msg("until", "until {0}", prog.getEndTimeString()));
int netLength = prog
.getIntField(ProgramFieldType.NET_PLAYING_TIME_TYPE);
if (netLength != -1) {
msg = mLocalizer.msg("netMinuted", "{0} min net", netLength);
buffer.append(" - ").append(msg);
}
buffer.append(')');
closePara(buffer);
buffer.append("</td></tr>");
addSeparator(doc, buffer);
}
}
} else if(id instanceof CompoundedProgramFieldType) {
CompoundedProgramFieldType value = (CompoundedProgramFieldType) id;
String entry = value.getFormattedValueForProgram(prog);
if(entry != null) {
startInfoSection(buffer, value.getName());
buffer.append(HTMLTextHelper.convertTextToHtml(entry, false));
addSeparator(doc,buffer);
}
}
else {
type = (ProgramFieldType) id;
if (type == ProgramFieldType.DESCRIPTION_TYPE) {
String description = checkDescription(prog.getDescription());
if (description != null
&& description.length() > 0) {
addEntry(doc, buffer, prog, ProgramFieldType.DESCRIPTION_TYPE, true,
showHelpLinks, showPersonLinks);
} else {
addEntry(doc, buffer, prog, ProgramFieldType.SHORT_DESCRIPTION_TYPE,
true, showHelpLinks,
showPersonLinks);
}
} else if (type == ProgramFieldType.INFO_TYPE) {
int info = prog.getInfo();
if ((info != -1) && (info != 0)) {
buffer
.append("<tr><td valign=\"top\" style=\"color:gray; font-size:");
buffer.append(mBodyFontSize);
buffer.append("\"><b>");
buffer
.append(type.getLocalizedName());
buffer
.append("</b></td><td valign=\"middle\" style=\"font-size:5\">");
openPara(buffer, "info");
// Workaround: Without the the component are not put in one
// line.
buffer.append(" ");
int[] infoBitArr = ProgramInfoHelper.getInfoBits();
Icon[] infoIconArr = ProgramInfoHelper.getInfoIcons();
String[] infoMsgArr = ProgramInfoHelper.getInfoIconMessages();
for (int i = 0; i < infoBitArr.length; i++) {
if (ProgramInfoHelper.bitSet(info, infoBitArr[i])) {
JLabel iconLabel;
if (infoIconArr[i] != null) {
iconLabel = new JLabel(infoIconArr[i]);
}
else {
iconLabel = new JLabel(infoMsgArr[i]);
}
iconLabel.setToolTipText(infoMsgArr[i]);
buffer.append(doc.createCompTag(iconLabel));
buffer.append(" ");
}
}
closePara(buffer);
buffer.append("</td></tr>");
addSeparator(doc, buffer);
}
} else if (type == ProgramFieldType.URL_TYPE) {
addEntry(doc, buffer, prog, ProgramFieldType.URL_TYPE, true,
showHelpLinks, showPersonLinks);
}
else if (type == ProgramFieldType.ACTOR_LIST_TYPE) {
ArrayList<String> knownNames = new ArrayList<String>();
String[] recognizedActors = ProgramUtilities.getActorNames(prog);
if (recognizedActors != null) {
knownNames.addAll(Arrays.asList(recognizedActors));
}
String actorField = prog.getTextField(type);
if (actorField != null) {
ArrayList<String>[] lists = ProgramUtilities.splitActors(prog);
if (lists == null) {
lists = splitActorsSimple(prog);
}
if (lists != null && lists[0].size() > 0) {
startInfoSection(buffer, type.getLocalizedName());
buffer.append("<table border=\"0\" cellpadding=\"0\" style=\"font-family:");
buffer.append(bodyFont);
buffer.append(";\">");
for (int i=0; i < lists[0].size(); i++) {
String[] parts = new String[2];