Search in sources :

Example 1 with HTMLTableWriter

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);
    }
}
Also used : HTMLTableWriter(net.sourceforge.processdash.ui.lib.HTMLTableWriter) CachedURLObject(net.sourceforge.processdash.net.cache.CachedURLObject)

Example 2 with HTMLTableWriter

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);
}
Also used : HTMLTableWriter(net.sourceforge.processdash.ui.lib.HTMLTableWriter)

Example 3 with HTMLTableWriter

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);
}
Also used : HTMLTableWriter(net.sourceforge.processdash.ui.lib.HTMLTableWriter) EVTaskListData(net.sourceforge.processdash.ev.EVTaskListData) TreeTableModel(net.sourceforge.processdash.ui.lib.TreeTableModel) TableModel(javax.swing.table.TableModel)

Example 4 with HTMLTableWriter

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());
}
Also used : HTMLTableWriter(net.sourceforge.processdash.ui.lib.HTMLTableWriter) StringWriter(java.io.StringWriter)

Example 5 with HTMLTableWriter

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());
}
Also used : HTMLTableWriter(net.sourceforge.processdash.ui.lib.HTMLTableWriter) StringWriter(java.io.StringWriter)

Aggregations

HTMLTableWriter (net.sourceforge.processdash.ui.lib.HTMLTableWriter)7 StringWriter (java.io.StringWriter)2 TableModel (javax.swing.table.TableModel)2 EVTaskListData (net.sourceforge.processdash.ev.EVTaskListData)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 List (java.util.List)1 Set (java.util.Set)1 EVSchedule (net.sourceforge.processdash.ev.EVSchedule)1 EVTaskList (net.sourceforge.processdash.ev.EVTaskList)1 EVTaskListRollup (net.sourceforge.processdash.ev.EVTaskListRollup)1 Resources (net.sourceforge.processdash.i18n.Resources)1 CachedURLObject (net.sourceforge.processdash.net.cache.CachedURLObject)1 TreeTableModel (net.sourceforge.processdash.ui.lib.TreeTableModel)1