org.displaytag.render
Class HtmlTableWriter

java.lang.Object
  extended by org.displaytag.render.TableWriterTemplate
      extended by org.displaytag.render.TableWriterAdapter
          extended by org.displaytag.render.HtmlTableWriter

public class HtmlTableWriter
extends TableWriterAdapter

A table writer that formats a table in HTML and writes it to a JSP page.

Since:
1.1
Version:
$Id$
Author:
Fabrizio Giustina, Jorge L. Barroso
See Also:
TableWriterTemplate

Field Summary
 
Fields inherited from class org.displaytag.render.TableWriterTemplate
GROUP_END, GROUP_NO_CHANGE, GROUP_START, GROUP_START_AND_END, NO_RESET_GROUP
 
Constructor Summary
HtmlTableWriter(TableModel tableModel, TableProperties tableProperties, Href baseHref, boolean export, javax.servlet.jsp.JspWriter out, CaptionTag captionTag, PaginatedList paginatedList, SmartListHelper listHelper, int pagesize, HtmlAttributeMap attributeMap, java.lang.String uid)
          This table writer uses a TableTag and a JspWriter to do its work.
 
Method Summary
 java.lang.String getOpenTag()
          create the open tag containing all the attributes.
 void write(java.lang.Object string)
          Utility method.
 void write(java.lang.String string)
          Utility method.
protected  void writeBottomBanner(TableModel model)
          Writes a banner containing search result, paging navigation, and export links below an HTML table to a JSP page.
protected  void writeCaption(TableModel model)
          Writes an HTML table's caption to a JSP page.
protected  void writeColumnCloser(Column column)
          Writes an HTML table's column-closing tag to a JSP page.
protected  void writeColumnOpener(Column column)
          Writes an HTML table's column-opening tag to a JSP page.
protected  void writeColumnValue(java.lang.Object value, Column column)
          Writes a HTML table column value to a JSP page.
protected  void writeDecoratedRowFinish(TableModel model)
          Called by writeTableBody to decorate the table.
protected  void writeDecoratedRowStart(TableModel model)
          Called by writeTableBody to write to decorate the table.
protected  void writeDecoratedTableFinish(TableModel model)
          Called by writeTable to decorate the table.
protected  void writeEmptyListMessage(java.lang.String emptyListMessage)
          Writes an HTML message to a JSP page explaining that the table model contains no data.
protected  void writeEmptyListRowMessage(java.lang.String message)
          Writes an HTML message to a JSP page explaining that the row contains no data.
 void writeNavigationAndExportLinks()
          Generates table footer with links for export commands.
protected  void writePreBodyFooter(TableModel model)
          Writes an HTML table's footer to a JSP page; HTML requires tfoot to appear before tbody.
protected  void writeRowCloser(Row row)
          Writes an HTML table's row-closing tag to a JSP page.
protected  void writeRowOpener(Row row)
          Writes an HTML table's row-opening tag to a JSP page.
protected  void writeRowWithNoColumns(java.lang.String rowValue)
          Writes to a JSP page an HTML table row that has no columns.
 void writeSearchResultAndNavigation()
          generates the search result and navigation bar.
 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  void writeTableBodyCloser(TableModel model)
          Writes the end of an HTML table's body to a JSP page.
protected  void writeTableBodyOpener(TableModel model)
          Writes the start of an HTML table's body to a JSP page.
protected  void writeTableCloser(TableModel model)
          Writes the closing structure of an HTML table to a JSP page.
protected  void writeTableHeader(TableModel model)
          Writes an HTML table's column header to a JSP page.
protected  void writeTableOpener(TableModel model)
          Writes an HTML table's opening tags to a JSP page.
protected  void writeTopBanner(TableModel model)
          Writes a banner containing search result and paging navigation above an HTML table to a JSP page.
 
Methods inherited from class org.displaytag.render.TableWriterAdapter
writePostBodyFooter
 
Methods inherited from class org.displaytag.render.TableWriterTemplate
groupColumns
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HtmlTableWriter

public HtmlTableWriter(TableModel tableModel,
                       TableProperties tableProperties,
                       Href baseHref,
                       boolean export,
                       javax.servlet.jsp.JspWriter out,
                       CaptionTag captionTag,
                       PaginatedList paginatedList,
                       SmartListHelper listHelper,
                       int pagesize,
                       HtmlAttributeMap attributeMap,
                       java.lang.String uid)
This table writer uses a TableTag and a JspWriter to do its work.

Parameters:
tableTag - TableTag instance called back by this writer.
out - The output destination.
Method Detail

writeTopBanner

protected void writeTopBanner(TableModel model)
Writes a banner containing search result and paging navigation above an HTML table to a JSP page.

Overrides:
writeTopBanner in class TableWriterAdapter
Parameters:
model - The table model for which the banner is written.
See Also:
TableWriterTemplate.writeTopBanner(org.displaytag.model.TableModel)

writeTableOpener

protected void writeTableOpener(TableModel model)
Writes an HTML table's opening tags to a JSP page.

Overrides:
writeTableOpener in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeTableOpener(org.displaytag.model.TableModel)

writeCaption

protected void writeCaption(TableModel model)
Writes an HTML table's caption to a JSP page.

Overrides:
writeCaption in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeCaption(org.displaytag.model.TableModel)

writePreBodyFooter

protected void writePreBodyFooter(TableModel model)
Writes an HTML table's footer to a JSP page; HTML requires tfoot to appear before tbody.

Overrides:
writePreBodyFooter in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
org.displaytag.render.TableWriterTemplate#writeFooter(org.displaytag.model.TableModel)

writeTableBodyOpener

protected void writeTableBodyOpener(TableModel model)
Writes the start of an HTML table's body to a JSP page.

Overrides:
writeTableBodyOpener in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeTableBodyOpener(org.displaytag.model.TableModel)

writeTableBodyCloser

protected void writeTableBodyCloser(TableModel model)
Writes the end of an HTML table's body to a JSP page.

Overrides:
writeTableBodyCloser in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeTableBodyCloser(org.displaytag.model.TableModel)

writeTableCloser

protected void writeTableCloser(TableModel model)
Writes the closing structure of an HTML table to a JSP page.

Overrides:
writeTableCloser in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeTableCloser(org.displaytag.model.TableModel)

writeBottomBanner

protected void writeBottomBanner(TableModel model)
Writes a banner containing search result, paging navigation, and export links below an HTML table to a JSP page.

Overrides:
writeBottomBanner in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeBottomBanner(org.displaytag.model.TableModel)

writeDecoratedTableFinish

protected void writeDecoratedTableFinish(TableModel model)
Description copied from class: TableWriterTemplate
Called by writeTable to decorate the table.

Overrides:
writeDecoratedTableFinish in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeDecoratedTableFinish(org.displaytag.model.TableModel)

writeDecoratedRowStart

protected void writeDecoratedRowStart(TableModel model)
Description copied from class: TableWriterTemplate
Called by writeTableBody to write to decorate the table.

Overrides:
writeDecoratedRowStart in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeDecoratedRowStart(org.displaytag.model.TableModel)

writeRowOpener

protected void writeRowOpener(Row row)
Writes an HTML table's row-opening tag to a JSP page.

Overrides:
writeRowOpener in class TableWriterAdapter
Parameters:
row - The table row for which the content is written.
See Also:
TableWriterTemplate.writeRowOpener(org.displaytag.model.Row)

writeColumnOpener

protected void writeColumnOpener(Column column)
                          throws ObjectLookupException,
                                 DecoratorException
Writes an HTML table's column-opening tag to a JSP page.

Overrides:
writeColumnOpener in class TableWriterAdapter
Parameters:
column - The table column for which the content is written.
Throws:
ObjectLookupException
DecoratorException
See Also:
TableWriterTemplate.writeColumnOpener(org.displaytag.model.Column)

writeColumnCloser

protected void writeColumnCloser(Column column)
Writes an HTML table's column-closing tag to a JSP page.

Overrides:
writeColumnCloser in class TableWriterAdapter
Parameters:
column - The table column for which the content is written.
See Also:
TableWriterTemplate.writeColumnCloser(org.displaytag.model.Column)

writeRowWithNoColumns

protected void writeRowWithNoColumns(java.lang.String rowValue)
Writes to a JSP page an HTML table row that has no columns.

Overrides:
writeRowWithNoColumns in class TableWriterAdapter
Parameters:
rowValue - The row value.
See Also:
TableWriterTemplate.writeRowWithNoColumns(java.lang.String)

writeRowCloser

protected void writeRowCloser(Row row)
Writes an HTML table's row-closing tag to a JSP page.

Overrides:
writeRowCloser in class TableWriterAdapter
Parameters:
row - The table row for which the content is written.
See Also:
TableWriterTemplate.writeRowCloser(org.displaytag.model.Row)

writeDecoratedRowFinish

protected void writeDecoratedRowFinish(TableModel model)
Description copied from class: TableWriterTemplate
Called by writeTableBody to decorate the table.

Overrides:
writeDecoratedRowFinish in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeDecoratedRowFinish(org.displaytag.model.TableModel)

writeEmptyListMessage

protected void writeEmptyListMessage(java.lang.String emptyListMessage)
Writes an HTML message to a JSP page explaining that the table model contains no data.

Overrides:
writeEmptyListMessage in class TableWriterAdapter
Parameters:
emptyListMessage - A message explaining that the table model contains no data.
See Also:
TableWriterTemplate.writeEmptyListMessage(java.lang.String)

writeColumnValue

protected void writeColumnValue(java.lang.Object value,
                                Column column)
Writes a HTML table column value to a JSP page.

Overrides:
writeColumnValue in class TableWriterAdapter
Parameters:
value - The column value.
column - The table column for which the content is written.
See Also:
org.displaytag.render.TableWriterTemplate#writeColumnValue(java.lang.String,org.displaytag.model.Column)

writeEmptyListRowMessage

protected void writeEmptyListRowMessage(java.lang.String message)
Writes an HTML message to a JSP page explaining that the row contains no data.

Overrides:
writeEmptyListRowMessage in class TableWriterAdapter
Parameters:
message - The message explaining that the row contains no data.
See Also:
TableWriterTemplate.writeEmptyListRowMessage(java.lang.String)

writeTableHeader

protected void writeTableHeader(TableModel model)
Writes an HTML table's column header to a JSP page.

Overrides:
writeTableHeader in class TableWriterAdapter
Parameters:
model - The table model for which the content is written.
See Also:
TableWriterTemplate.writeTableHeader(org.displaytag.model.TableModel)

writeNavigationAndExportLinks

public void writeNavigationAndExportLinks()
Generates table footer with links for export commands.


writeSearchResultAndNavigation

public void writeSearchResultAndNavigation()
generates the search result and navigation bar.


getOpenTag

public java.lang.String getOpenTag()
create the open tag containing all the attributes.

Returns:
open tag string: %lt;table attribute="value" ... >

write

public void write(java.lang.String string)
Utility method.

Parameters:
string - String

writeTable

public void writeTable(TableModel model,
                       java.lang.String id)
                throws javax.servlet.jsp.JspException
Description copied from class: TableWriterTemplate
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.)

Overrides:
writeTable in class TableWriterTemplate
Parameters:
model - The table model used to build the table.
id - This table's page id.
Throws:
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.

write

public void write(java.lang.Object string)
Utility method.

Parameters:
string - String


Copyright © 2002-2007 the Displaytag team. All Rights Reserved.