tweaked per Luke's suggestions, thanks!

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@1358 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Tom Copeland
2003-01-21 17:43:14 +00:00
parent bdd7f56e5b
commit c1a3abf154

View File

@ -12,19 +12,16 @@ import java.util.Iterator;
public class HTMLRenderer implements Renderer {
/**
* The end of line string for this machine.
*/
protected String EOL = System.getProperty("line.separator", "\n");
public String render(Report report) {
StringBuffer buf = new StringBuffer("<html><head><title>PMD</title></head><body>" + EOL+ "<table align=\"center\"><tr>" + EOL+ "<th>File</th><th>Line</th><th>Problem</th></tr>" + EOL);
StringBuffer buf = new StringBuffer("<html><head><title>PMD</title></head><body>" + EOL+ "<table align=\"center\" cellspacing=\"0\" cellpadding=\"3\"><tr>" + EOL+ "<th>File</th><th>Line</th><th>Problem</th></tr>" + EOL);
boolean colorize = true;
for (Iterator i = report.iterator(); i.hasNext();) {
RuleViolation rv = (RuleViolation) i.next();
buf.append("<tr ");
if (colorize) {
buf.append("bgcolor=\"#00FFFF\"");
buf.append("bgcolor=\"lightgrey\"");
colorize = false;
} else {
colorize = true;