|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.displaytag.render.TableWriterTemplate
public abstract class TableWriterTemplate
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.)
| Field Summary | |
|---|---|
static short |
GROUP_END
|
static short |
GROUP_NO_CHANGE
|
static short |
GROUP_START
|
static short |
GROUP_START_AND_END
|
protected static int |
NO_RESET_GROUP
|
| Constructor Summary | |
|---|---|
TableWriterTemplate()
|
|
| Method Summary | |
|---|---|
protected short |
groupColumns(java.lang.String value,
java.lang.String previous,
java.lang.String next,
int currentGroup)
This takes a column value and grouping index as the argument. |
protected abstract void |
writeBottomBanner(TableModel model)
Called by writeTable to write the table's footer. |
protected abstract void |
writeCaption(TableModel model)
Called by writeTable to write the table's caption. |
protected abstract void |
writeColumnCloser(Column column)
Called by writeTableBody to write the end of the column structure. |
protected abstract void |
writeColumnOpener(Column column)
Called by writeTableBody to write the start of the column structure. |
protected abstract void |
writeColumnValue(java.lang.Object value,
Column column)
Called by writeTableBody to write a column's value. |
protected abstract void |
writeDecoratedRowFinish(TableModel model)
Called by writeTableBody to decorate the table. |
protected abstract void |
writeDecoratedRowStart(TableModel model)
Called by writeTableBody to write to decorate the table. |
protected abstract void |
writeDecoratedTableFinish(TableModel model)
Called by writeTable to decorate the table. |
protected abstract void |
writeEmptyListMessage(java.lang.String emptyListMessage)
Called by writeTable to write a message explaining that the table model contains no data. |
protected abstract void |
writeEmptyListRowMessage(java.lang.String message)
Called by writeTableBody to write a message explaining that the row contains no data. |
protected abstract void |
writePostBodyFooter(TableModel model)
Called by writeTable to write table footer after table body. |
protected abstract void |
writePreBodyFooter(TableModel model)
Called by writeTable to write table footer before table body. |
protected abstract void |
writeRowCloser(Row row)
Called by writeTableBody to write the end of the row structure. |
protected abstract void |
writeRowOpener(Row row)
Called by writeTableBody to write the start of the row structure. |
protected abstract void |
writeRowWithNoColumns(java.lang.String value)
Called by writeTableBody to write a row that has no columns. |
void |
writeTable(TableModel model,
java.lang.String id)
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. |
protected abstract void |
writeTableBodyCloser(TableModel model)
Called by writeTable to write the end of the table's body. |
protected abstract void |
writeTableBodyOpener(TableModel model)
Called by writeTable to write the start of the table's body. |
protected abstract void |
writeTableCloser(TableModel model)
Called by writeTable to write the end of the table's structure. |
protected abstract void |
writeTableHeader(TableModel model)
Called by writeTable to write the table's header columns. |
protected abstract void |
writeTableOpener(TableModel model)
Called by writeTable to write the start of the table structure. |
protected abstract void |
writeTopBanner(TableModel model)
Called by writeTable to write a summary of the search result this table reports and the table's pagination interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public TableWriterTemplate()
| Method Detail |
|---|
public void writeTable(TableModel model,
java.lang.String id)
throws javax.servlet.jsp.JspException
model - The table model used to build the table.id - This table's page id.
javax.servlet.jsp.JspException - if any exception thrown while constructing the tablei, it is caught and rethrown as a
JspException. Extension classes may throw all sorts of exceptions, depending on their respective formats and
destinations.
protected abstract void writeEmptyListMessage(java.lang.String emptyListMessage)
throws java.lang.Exception
emptyListMessage - A message explaining that the table model contains no data.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTopBanner(TableModel model)
throws java.lang.Exception
model - The table model for which the banner is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTableOpener(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeCaption(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTableHeader(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writePreBodyFooter(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTableBodyOpener(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTableBodyCloser(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writePostBodyFooter(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeTableCloser(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeDecoratedTableFinish(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeBottomBanner(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeDecoratedRowStart(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeRowOpener(Row row)
throws java.lang.Exception
row - The table row for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeColumnOpener(Column column)
throws java.lang.Exception
column - The table column for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeColumnValue(java.lang.Object value,
Column column)
throws java.lang.Exception
value - The column value.column - The table column for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeColumnCloser(Column column)
throws java.lang.Exception
column - The table column for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeRowWithNoColumns(java.lang.String value)
throws java.lang.Exception
value - The row value.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeRowCloser(Row row)
throws java.lang.Exception
row - The table row for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeDecoratedRowFinish(TableModel model)
throws java.lang.Exception
model - The table model for which the content is written.
java.lang.Exception - if it encounters an error while writing.
protected abstract void writeEmptyListRowMessage(java.lang.String message)
throws java.lang.Exception
message - The message explaining that the row contains no data.
java.lang.Exception - if it encounters an error while writing.
protected short groupColumns(java.lang.String value,
java.lang.String previous,
java.lang.String next,
int currentGroup)
value - String current cell value
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||