com.sas.servlet.tbeans.tableview.html
Class HtmlTableViewUtil

com.sas.servlet.tbeans.tableview.html.HtmlTableViewUtil

public abstract class HtmlTableViewUtil

The HtmlTableViewUtil class provides several static functions needed by the html tableviews. It provides default implementation for several of the write methods need to render an html TableView. This class is used by the classes com.sas.servlet.tbeans.tableview.html.TableView and com.sas.servlet.tbeans.olaptableview.html.OLAPTableView.

This class implements the methods: writeTableHeader, writeTableFooter, writeEmptyTable, and writeActions.

See Also:
TableView, OLAPTableView

Constructor Summary
HtmlTableViewUtil()
           
 
Method Summary
static void setOnModificationEvent(AbstractBaseTableView tableView, java.lang.Object renderer)
          This method is used by the TableView to set the event to be called when the cell is modified.
static void setOnRowSelectionEvent(AbstractBaseTableView tableView, java.lang.Object renderer)
          This method is used by the TableView to set the event to be called when the row is selected.
static void writeActions(AbstractBaseTableView tableview, ActionList actions, java.io.PrintWriter out)
          Writes the actions in the actions list.
static void writeActions(AbstractBaseTableView tableview, ActionList actions, java.io.PrintWriter out, boolean encodeText)
          Writes the actions in the actions list.
static void writeColumnsPercentageWidthForOptimizedTreeTableView(AbstractBaseTableView tableView, java.io.PrintWriter out)
          For an optimized TreeTableView we want the tree column to have full width regardless of the percentage width set on the Table.
static void writeEmptyTable(AbstractBaseTableView tableView, java.io.PrintWriter out)
          Writes an empty table when a model in not attached
static void writeTableFooter(AbstractBaseTableView tableView, java.io.PrintWriter out)
          Writes the footer tag for the tableview.
static void writeTableHeader(AbstractBaseTableView tableView, java.io.PrintWriter out)
          Writes the header tag and all its attributes for tableview.
 

Constructor Detail

HtmlTableViewUtil

public HtmlTableViewUtil()
Method Detail

writeTableHeader

public static void writeTableHeader(AbstractBaseTableView tableView,
                                    java.io.PrintWriter out)
                             throws java.io.IOException
Writes the header tag and all its attributes for tableview.

Parameters:
tableView - the tableView calling this method written
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeTableFooter

public static void writeTableFooter(AbstractBaseTableView tableView,
                                    java.io.PrintWriter out)
                             throws java.io.IOException
Writes the footer tag for the tableview.

Parameters:
tableView - the tableView calling this method written
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeEmptyTable

public static void writeEmptyTable(AbstractBaseTableView tableView,
                                   java.io.PrintWriter out)
                            throws java.io.IOException
Writes an empty table when a model in not attached

Parameters:
tableView - the tableView calling this method written
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeColumnsPercentageWidthForOptimizedTreeTableView

public static void writeColumnsPercentageWidthForOptimizedTreeTableView(AbstractBaseTableView tableView,
                                                                        java.io.PrintWriter out)
For an optimized TreeTableView we want the tree column to have full width regardless of the percentage width set on the Table. This method writes the wanted column width, column by column, setting a 100% width for the first column (the tree column), and setting the current Table percentage width to the remaining columns (the data columns). It uses tags to specify column widths.

Parameters:
tableView - the TreeTableView for which a percentage width has been specified
out - the output stream to write the HTML code to

writeActions

public static void writeActions(AbstractBaseTableView tableview,
                                ActionList actions,
                                java.io.PrintWriter out)
                         throws java.io.IOException
Writes the actions in the actions list.

Parameters:
actions - the actions to render
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeActions

public static void writeActions(AbstractBaseTableView tableview,
                                ActionList actions,
                                java.io.PrintWriter out,
                                boolean encodeText)
                         throws java.io.IOException
Writes the actions in the actions list.

Parameters:
actions - the actions to render
out - the output stream
encodeText - encode the Label's text
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

setOnModificationEvent

public static void setOnModificationEvent(AbstractBaseTableView tableView,
                                          java.lang.Object renderer)
                                   throws java.io.IOException
This method is used by the TableView to set the event to be called when the cell is modified. The TableView must implement FormViewInterface and the renderer must implement FormElementModificationEventInterface for the event to be set.

Parameters:
renderer - An instance of the CellContentsRenderer or CellContentsEditor on which to set the onModificationEvent
Throws:
java.io.IOException

setOnRowSelectionEvent

public static void setOnRowSelectionEvent(AbstractBaseTableView tableView,
                                          java.lang.Object renderer)
                                   throws java.io.IOException
This method is used by the TableView to set the event to be called when the row is selected. The TableView must implement FormViewInterface and the renderer must implement FormElementModificationEventInterface for the event to be set.

Parameters:
renderer - An instance of the CellContentsRenderer or CellContentsEditor on which to set the onModificationEvent
Throws:
java.io.IOException



Copyright © 2009 SAS Institute Inc. All Rights Reserved.