com.sas.servlet.tbeans.remotefileselector2.html
Class ColumnAsRowCellRenderer

com.sas.servlet.tbeans.remotefileselector2.html.ColumnAsRowCellRenderer
All Implemented Interfaces:
HttpConstants, StyleInterface, TableCell, TableCellRenderer, javax.swing.SwingConstants

public class ColumnAsRowCellRenderer

ColumnAsRowCellRenderer is a class that constructs a TableCellRenderer which writes out the last column in a TableView as a row. This renderer is used to render the Description column as a row in the RemoteFileSelector transformation bean.

This cell renderer specifically ends the previous row with a </tr>, starts a new row with a <tr>, and sets the style class to match the previous row. The data rendered in this row is associated with the previous row. This renderer can be used with instances of the TableView component.


Field Summary
 
Fields inherited from interface com.sas.servlet.tbeans.HttpConstants
ALL, BASELINE, CHAR, COL, COLGROUP, JUSTIFY, MULTIPLE, NONE, ROW, ROWGROUP, SINGLE
 
Constructor Summary
ColumnAsRowCellRenderer()
          Constructs a new ColumnAsRowCellRenderer.
 
Method Summary
protected  int getDescriptionCount()
          Returns the current description count.
protected  void setDescriptionCount(int count)
          Sets the number appended to the renderer name to generate an id for the <td> tag containing a description or some data.
 void write(java.io.PrintWriter out, AbstractBaseTableView tableview, java.lang.Object value, java.lang.String name, ActionList actions)
           Renders the last column in a TableView as a row.
 
Methods inherited from class com.sas.servlet.tbeans.remotefileselector2.BaseFieldRenderer
getArrayName, getName, getStartColumn, isFieldRenderable, isVisible, setArrayName, setFieldRenderable, setName, setStartColumn, setVisible
 
Methods inherited from class com.sas.servlet.tbeans.tableview.html.DefaultTableCellRenderer
getTableCellContentsRenderer, setTableCellContentsRenderer
 
Methods inherited from class com.sas.servlet.tbeans.tableview.html.BaseTableCell
getBgColor, getColSpan, getCustomAttributes, getHeaders, getHeight, getHeightPercentage, getHorizontalAlignment, getId, getLocale, getRowSpan, getScope, getStyleInfo, getVerticalAlignment, getWidth, getWidthPercentage, isHeader, isNoWrap, setBgColor, setColSpan, setCustomAttributes, setHeader, setHeaders, setHeight, setHeightPercentage, setHorizontalAlignment, setId, setLocale, setNoWrap, setRowSpan, setScope, setStyleInfo, setVerticalAlignment, setWidth, setWidthPercentage, writeBeginCell, writeEndCell
 
Methods inherited from interface com.sas.servlet.tbeans.tableview.TableCellRenderer
getLocale, setLocale
 
Methods inherited from interface com.sas.servlet.tbeans.tableview.TableCell
isHeader, setHeader, writeBeginCell, writeEndCell
 

Constructor Detail

ColumnAsRowCellRenderer

public ColumnAsRowCellRenderer()
Constructs a new ColumnAsRowCellRenderer. The description count is set to 0 by default.

Method Detail

setDescriptionCount

protected void setDescriptionCount(int count)
Sets the number appended to the renderer name to generate an id for the <td> tag containing a description or some data. The id for each <td> tag must uniquely identify the table cell. This count is incremented by 1 each time a description is rendered. By default the description count starts at 0 when the renderer is instantiated.

Parameters:
count - description identifier
See Also:
getDescriptionCount()

getDescriptionCount

protected int getDescriptionCount()
Returns the current description count. This number is appended to the table cell or <td> tag id. The <td> tag ids are used to obtain and store the table cell instance in the array. JavaScript uses the table cells in the array to obtain the parent <tr> tags. The table row style is set to block to show the descriptions or to none to hide the descriptions.

Returns:
description count used to uniquely identify each description table cell,
See Also:
setDescriptionCount(int)

write

public void write(java.io.PrintWriter out,
                  AbstractBaseTableView tableview,
                  java.lang.Object value,
                  java.lang.String name,
                  ActionList actions)
           throws java.io.IOException

Renders the last column in a TableView as a row. JavaScript is also generated to save the description values in an array so that the value can be hidden or displayed based on the selection of the Show Description CheckBox component.

If isFieldRenderable() returns false then nothing is rendered or written out for the value. This prevents the display of unused code in the case where the description row is never displayed. If isFieldRenderable() returns true then if a description exists it is renderered along with the necessary JavaScript for storing the description value.

If isVisible() returns false the descrption is rendered with a display style of none. Therefore, the description is hidden. If isVisible() returns true the description is rendered with a display style of block. Therefore, the description is visible.

Specified by:
write in interface TableCell
Overrides:
write in class DefaultTableCellRenderer
Parameters:
out - the output stream
tableview - the instance of the tableview being written
value - the value to display as the cell's contents
name - the name to use for the contents component
actions - an actionlist of all the valid actions for this cell
Throws:
java.io.IOException - Thrown if some type of I/O error occurs



Copyright © 2009 SAS Institute Inc. All Rights Reserved.