use of org.jacoco.report.internal.html.HTMLElement in project jacoco by jacoco.
the class ReportPage method body.
private void body(final HTMLElement body) throws IOException {
body.attr("onload", getOnload());
final HTMLElement navigation = body.div(Styles.BREADCRUMB);
navigation.attr("id", "breadcrumb");
infoLinks(navigation.span(Styles.INFO));
breadcrumb(navigation, folder);
body.h1().text(getLinkLabel());
content(body);
footer(body);
}
use of org.jacoco.report.internal.html.HTMLElement in project jacoco by jacoco.
the class ReportPage method footer.
private void footer(final HTMLElement body) throws IOException {
final HTMLElement footer = body.div(Styles.FOOTER);
final HTMLElement versioninfo = footer.span(Styles.RIGHT);
versioninfo.text("Created with ");
versioninfo.a(JaCoCo.HOMEURL).text("JaCoCo");
versioninfo.text(" ").text(JaCoCo.VERSION);
footer.text(context.getFooterText());
}
use of org.jacoco.report.internal.html.HTMLElement in project jacoco by jacoco.
the class SessionsPage method sessionTable.
private void sessionTable(final HTMLElement body) throws IOException {
final HTMLElement table = body.table(Styles.COVERAGETABLE);
{
final HTMLElement tr = table.thead().tr();
tr.td().text("Session");
tr.td().text("Start Time");
tr.td().text("Dump Time");
}
final HTMLElement tbody = table.tbody();
for (final SessionInfo i : sessionInfos) {
final HTMLElement tr = tbody.tr();
tr.td().span(Styles.EL_SESSION).text(i.getId());
tr.td().text(dateFormat.format(new Date(i.getStartTimeStamp())));
tr.td().text(dateFormat.format(new Date(i.getDumpTimeStamp())));
}
}
use of org.jacoco.report.internal.html.HTMLElement in project jacoco by jacoco.
the class SessionsPage method executionDataTable.
private void executionDataTable(final HTMLElement body) throws IOException {
final HTMLElement table = body.table(Styles.COVERAGETABLE);
{
final HTMLElement tr = table.thead().tr();
tr.td().text("Class");
tr.td().text("Id");
}
final HTMLElement tbody = table.tbody();
final ILanguageNames names = context.getLanguageNames();
for (final ExecutionData e : executionData) {
final HTMLElement tr = tbody.tr();
final String link = index.getLinkToClass(e.getId());
final String qualifiedName = names.getQualifiedClassName(e.getName());
if (link == null) {
tr.td().span(Styles.EL_CLASS).text(qualifiedName);
} else {
tr.td().a(link, Styles.EL_CLASS).text(qualifiedName);
}
final String id = String.format("%016x", Long.valueOf(e.getId()));
tr.td().code().text(id);
}
}
use of org.jacoco.report.internal.html.HTMLElement in project jacoco by jacoco.
the class SourceHighlighter method render.
/**
* Highlights the given source file.
*
* @param parent
* parent HTML element
* @param source
* highlighting information
* @param contents
* contents of the source file
* @throws IOException
* problems while reading the source file or writing the output
*/
public void render(final HTMLElement parent, final ISourceNode source, final Reader contents) throws IOException {
final HTMLElement pre = parent.pre(Styles.SOURCE + " lang-" + lang + " linenums");
final BufferedReader lineBuffer = new BufferedReader(contents);
String line;
int nr = 0;
while ((line = lineBuffer.readLine()) != null) {
nr++;
renderCodeLine(pre, line, source.getLine(nr), nr);
}
}
Aggregations