String createFormTextContent(IMessage[] messages) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
pw.println("<form>");
for (int i = 0; i < messages.length; i++) {
IMessage message = messages[i];
pw
.print("<li vspace=\"false\" style=\"image\" indent=\"16\" value=\"");
switch (message.getMessageType()) {
case IMessageProvider.ERROR:
pw.print("error");
break;
case IMessageProvider.WARNING:
pw.print("warning");
break;
case IMessageProvider.INFORMATION:
pw.print("info");
break;
}
pw.print("\"> <a href=\"");
pw.print(i+"");
pw.print("\">");
if (message.getPrefix() != null)
pw.print(message.getPrefix());
pw.print(message.getMessage());
pw.println("</a></li>");
}
pw.println("</form>");
pw.flush();
return sw.toString();