Home » displaytag-1.1.1-src » org » displaytag » render » [javadoc | source]
org.displaytag.render
abstract public class: TableWriterTemplate [javadoc | source]
java.lang.Object
   org.displaytag.render.TableWriterTemplate

Direct Known Subclasses:
    TableWriterAdapter, ItextTableWriter, HtmlTableWriter, HssfTableWriter

A template that encapsulates and drives the construction of a table based on a given table model and configuration. This class is meant to be extended by classes that build tables sharing the same structure, sorting, and grouping, but that write them in different formats and to various destinations. Subclasses must provide the format- and destination-specific implementations of the abstract methods this class calls to build a table. (Background: This class came about because our users wanted to export tables to Excel and PDF just as they were presented in HTML. It originates with the TableTagData.writeHTMLData method, factoring its logic so that it can be re-used by classes that write the tables as PDF, Excel, RTF and other formats. TableTagData.writeHTMLData now calls an HTML extension of this class to write tables in HTML format to a JSP page.)
Nested Class Summary:
static class  TableWriterTemplate.CellStruct   
Field Summary
public static final  short GROUP_START     
public static final  short GROUP_END     
public static final  short GROUP_START_AND_END     
public static final  short GROUP_NO_CHANGE     
protected static final  int NO_RESET_GROUP     
 int lowestEndedGroup     
 int lowestStartedGroup     
Method from org.displaytag.render.TableWriterTemplate Summary:
groupColumns,   writeBottomBanner,   writeCaption,   writeColumnCloser,   writeColumnOpener,   writeColumnValue,   writeDecoratedRowFinish,   writeDecoratedRowStart,   writeDecoratedTableFinish,   writeEmptyListMessage,   writeEmptyListRowMessage,   writePostBodyFooter,   writePreBodyFooter,   writeRowCloser,   writeRowOpener,   writeRowWithNoColumns,   writeTable,   writeTableBodyCloser,   writeTableBodyOpener,   writeTableCloser,   writeTableHeader,   writeTableOpener,   writeTopBanner
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.displaytag.render.TableWriterTemplate Detail:
 protected short groupColumns(String value,
    String previous,
    String next,
    int currentGroup) 
    This takes a column value and grouping index as the argument. It then groups the column and returns the appropriate string back to the caller.
 abstract protected  void writeBottomBanner(TableModel model) throws Exception
    Called by writeTable to write the table's footer.
 abstract protected  void writeCaption(TableModel model) throws Exception
    Called by writeTable to write the table's caption.
 abstract protected  void writeColumnCloser(Column column) throws Exception
    Called by writeTableBody to write the end of the column structure.
 abstract protected  void writeColumnOpener(Column column) throws Exception
    Called by writeTableBody to write the start of the column structure.
 abstract protected  void writeColumnValue(Object value,
    Column column) throws Exception
    Called by writeTableBody to write a column's value.
 abstract protected  void writeDecoratedRowFinish(TableModel model) throws Exception
    Called by writeTableBody to decorate the table.
 abstract protected  void writeDecoratedRowStart(TableModel model) throws Exception
    Called by writeTableBody to write to decorate the table.
 abstract protected  void writeDecoratedTableFinish(TableModel model) throws Exception
    Called by writeTable to decorate the table.
 abstract protected  void writeEmptyListMessage(String emptyListMessage) throws Exception
    Called by writeTable to write a message explaining that the table model contains no data.
 abstract protected  void writeEmptyListRowMessage(String message) throws Exception
    Called by writeTableBody to write a message explaining that the row contains no data.
 abstract protected  void writePostBodyFooter(TableModel model) throws Exception
    Called by writeTable to write table footer after table body.
 abstract protected  void writePreBodyFooter(TableModel model) throws Exception
    Called by writeTable to write table footer before table body.
 abstract protected  void writeRowCloser(Row row) throws Exception
    Called by writeTableBody to write the end of the row structure.
 abstract protected  void writeRowOpener(Row row) throws Exception
    Called by writeTableBody to write the start of the row structure.
 abstract protected  void writeRowWithNoColumns(String value) throws Exception
    Called by writeTableBody to write a row that has no columns.
 public  void writeTable(TableModel model,
    String id) throws JspException 
    Given a table model, this method creates a table, sorting and grouping it per its configuration, while delegating where and how it writes the table to subclass objects. (Background: This method refactors TableTagData.writeHTMLData method. See above.)
 abstract protected  void writeTableBodyCloser(TableModel model) throws Exception
    Called by writeTable to write the end of the table's body.
 abstract protected  void writeTableBodyOpener(TableModel model) throws Exception
    Called by writeTable to write the start of the table's body.
 abstract protected  void writeTableCloser(TableModel model) throws Exception
    Called by writeTable to write the end of the table's structure.
 abstract protected  void writeTableHeader(TableModel model) throws Exception
    Called by writeTable to write the table's header columns.
 abstract protected  void writeTableOpener(TableModel model) throws Exception
    Called by writeTable to write the start of the table structure.
 abstract protected  void writeTopBanner(TableModel model) throws Exception
    Called by writeTable to write a summary of the search result this table reports and the table's pagination interface.