use of net.sourceforge.processdash.ui.lib.HTMLTableWriter in project processdash by dtuma.
the class EVReport method setupRenderers.
private static void setupRenderers(HTMLTableWriter w, Object[] formats) {
w.setCellRenderer(EV_CELL_RENDERER);
for (int col = 0; col < formats.length; col++) {
Object cellRenderer = RENDERERS.get(formats[col]);
if (cellRenderer == null)
cellRenderer = EV_CELL_RENDERER;
w.setCellRenderer(col, (HTMLTableWriter.CellRenderer) cellRenderer);
}
}
use of net.sourceforge.processdash.ui.lib.HTMLTableWriter in project processdash by dtuma.
the class EVReport method writeScheduleTable.
void writeScheduleTable(EVSchedule s) throws IOException {
HTMLTableWriter writer = new HTMLTableWriter();
customizeTableWriter(writer, s, s.getColumnTooltips());
setupRenderers(writer, EVSchedule.COLUMN_FORMATS);
writer.setSkipColumn(EVSchedule.NOTES_COLUMN, true);
writer.setTableName("SCHEDULE");
writer.writeTable(out, s);
}
use of net.sourceforge.processdash.ui.lib.HTMLTableWriter in project processdash by dtuma.
the class EVReport method writeTaskTable.
private static void writeTaskTable(Writer out, EVTaskList taskList, EVTaskFilter filter, EVReportSettings settings, String namespace) throws IOException {
HTMLTableWriter writer = new HTMLTableWriter();
boolean showTimingIcons = taskList instanceof EVTaskListData && !settings.isExporting();
TableModel table = customizeTaskTableWriter(writer, taskList, filter, settings, showTimingIcons);
writer.setTableAttributes("class='sortable' id='" + namespace + "task' border='1'");
writer.writeTable(out, table);
}
use of net.sourceforge.processdash.ui.lib.HTMLTableWriter in project processdash by dtuma.
the class HTMLTableWriterTest method testDefaultRendering.
public void testDefaultRendering() throws Exception {
StringWriter out = new StringWriter();
HTMLTableWriter writer = new HTMLTableWriter();
writer.writeTable(out, data);
assertEquals(EXPECTED_DEFAULT_RENDERING, out.toString());
}
use of net.sourceforge.processdash.ui.lib.HTMLTableWriter in project processdash by dtuma.
the class HTMLTableWriterTest method testFancyRendering.
public void testFancyRendering() throws Exception {
StringWriter out = new StringWriter();
HTMLTableWriter writer = new HTMLTableWriter();
String[] toolTips = new String[] { null, "bb" };
//
HTMLTableWriter.DefaultHTMLHeaderCellRenderer headerRenderer = new HTMLTableWriter.DefaultHTMLHeaderCellRenderer(toolTips);
writer.setHeaderRenderer(headerRenderer);
HTMLTableWriter.CellRenderer cellRend = new HTMLTableWriter.DefaultHTMLTableCellRenderer() {
public String getAttributes(Object value, int row, int column) {
return (((row + column) & 1) == 0 ? null : CLASS_ODD);
}
};
writer.setCellRenderer(cellRend);
writer.setTableAttributes("border=1");
writer.setTableName("this&that");
writer.setWhitespace(HTMLTableWriter.WHITESPACE_ROWS);
writer.writeTable(out, data);
assertEquals(EXPECTED_FANCY_RENDERING, out.toString());
}
Aggregations