com.sas.servlet.tbeans.tableview.wml
Class TableView

com.sas.servlet.tbeans.tableview.wml.TableView
All Implemented Interfaces:
ActionProviderViewInterface, HttpActionProviderInterface, HttpActionProviderViewInterface, com.sas.actionprovider.refresh.PartialRefreshActionsInterface, URLTemplateViewInterface, com.sas.beans.PropertyChangeSource, com.sas.lang.ObjectDataInterface, com.sas.servlet.tbeans.AJAXControllerURLInterface, ComplexStyleInterface, com.sas.servlet.tbeans.features.FeatureListInterface, HttpConstants, BaseNavigationInterface, ColumnNavigationInterface, EditNavigationInterface, RowNavigationInterface, RenderableInterface, ExportAsHyperlinkInterface, TableColumnModelListener, TransformationInterface, com.sas.servlet.tbeans.TransformationInterface2, AccurateRowCountInterface, com.sas.table.MoveColumnInterface, com.sas.util.WriteToPrintWriterInterface, java.io.Serializable, java.util.EventListener, javax.swing.event.TableModelListener, javax.swing.SwingConstants

public class TableView

The TableView is a TransformationBean™ that generates a WML table with the data from the given model and format the 2-dimensional table.

The TableColumn provides a slot for holding an identifier or "tag" for each column, and the TableView and TableColumnModel both support getColumn(Object id) conveniences for locating columns by their identifier. If no identifier is explicitly set, the TableColumn returns its header value (the name of the column) as a default. A different identifier, which can be of any type, can be set using the TableColumn's setIdentifier method. All of the TableView's functions operate correctly regardless of the type and uniqueness of these identifiers.

See Also:
BaseTableView, Serialized Form

Field Summary
 
Fields inherited from class com.sas.servlet.tbeans.tableview.BaseTableView
columnsToExportAsTextIfCustomFormatted, columnsToNotEncode, EDITROW, LASTROW
 
Fields inherited from class com.sas.servlet.tbeans.tableview.AbstractBaseTableView
DEFAULT_EXPORT_NUMERIC_CUSTOM_FORMATED_VALUES_AS_TEXT, MISSING_STYLEINFO, WRAP_ALL, WRAP_NONE, WRAP_PER_COLUMN
 
Fields inherited from interface com.sas.servlet.tbeans.tableview.ExportAsHyperlinkInterface
DEFAULT_VALUE_FOR_CURRENT_VALUE_TO_ENCODE
 
Fields inherited from interface com.sas.servlet.tbeans.HttpConstants
ALL, BASELINE, CHAR, COL, COLGROUP, JUSTIFY, MULTIPLE, NONE, ROW, ROWGROUP, SINGLE
 
Constructor Summary
TableView()
          Constructs a new default TableView with a null data model, a null column model and a null row model.
TableView(int numRows, int numColumns)
          Constructs a TableView with numRows and numColumns of empty cells using DefaultTableModel.
TableView(java.lang.Object[][] rowData, java.lang.Object[] columnNames)
          Constructs a TableView to display the values in the two dimensional array, rowData, with column names, columnNames.
TableView(javax.swing.table.TableModel tableModel)
          Constructs a TableView that is initialized with tableModel as the data model, a default column model, and a default row model.
TableView(javax.swing.table.TableModel tableModel, TableColumnModel columnModel)
          Constructs a TableView that is initialized with tableModel as the data model and columnModel as the column model, and a default row model.
TableView(javax.swing.table.TableModel tm, TableColumnModel cm, TableRowModel rm)
          Constructs a TableView that is initialized with tableModel as the data model, columnModel as the column model and rowModel as the row model.
TableView(java.util.Vector rowData, java.util.Vector columnNames)
          Constructs a TableView to display the values in the Vector of Vectors, rowData, with column names, columnNames.
 
Method Summary
 BaseColumnHeader getDefaultColumnHeader()
          Returns the default columnHeader for the TableView.
 TableRowRenderer getDefaultColumnHeaderRowRenderer()
          Gets the default row renderer for the TableView's column header row.
 TableColumnModel getDefaultColumnModel()
          Returns the default column model for the TableView.
 TableColumn getDefaultEditColumn()
          Method not implemented, returns null.
 HttpEditController getDefaultEditController()
          Method not implemented, returns null.
 TableCellEditor getDefaultEditor()
          Editing not implemented on this class, returns null.
 TableCellContentsRenderer getDefaultNoRowsRenderer()
          Gets the default noRows cell content renderer for the TableView.
 TableCellRenderer getDefaultRenderer()
          Gets the default cell renderer for the TableView.
 BaseRowHeader getDefaultRowHeader()
          Returns the default rowHeader for the TableView.
 TableRowModel getDefaultRowModel()
          Returns the default row model for the TableView.
 TableRowRenderer getDefaultRowRenderer()
          Gets the default row renderer for the TableView.
 TableColumn getDefaultRowSelectionColumn()
          Method not implemented, returns null.
 java.lang.String getTitle()
          Gets the title of the table.
 void setDefaultColumnHeaderRowRenderer(TableRowRenderer renderer)
          Sets the default row renderer for the TableView's column header row.
 void setDefaultRenderer(TableCellRenderer renderer)
          Sets the default cell renderer for the TableView.
 void setDefaultRowRenderer(TableRowRenderer renderer)
          Sets the default row renderer for the TableView.
 void setTitle(java.lang.String value)
          Sets the title of the table.
 void writeColumnHeader(java.io.PrintWriter out)
          Writes the headerValue for each column in the column model.
 void writeEmptyTable(java.io.PrintWriter out)
          Writes an empty table when a data model in not attached or the data model has no rows in it.
protected  void writeRows(java.io.PrintWriter out)
          Writes the rows of data for the tableview.
 void writeTableFooter(java.io.PrintWriter out)
          Writes the footer tag for the tableview.
 void writeTableHeader(java.io.PrintWriter out)
          Writes the header tag and all its attributes for tableview.
 
Methods inherited from class com.sas.servlet.tbeans.tableview.BaseTableView
addColumn, cancel, cleanUpResources, columnAdded, columnMoved, columnRemoved, commit, createDefaultColumnsFromModel, delete, getAutoCreateColumnsFromModel, getCellEditor, getCellRenderer, getColumn, getColumnCount, getColumnHeader, getColumnHeaderActions, getColumnHeaderAreaRenderer, getColumnModel, getColumnScrollSize, getColumnsToExportAsTextIfCustomFormatted, getColumnUniqueModelId, getCurrentColumn, getCurrentRow, getDataCellActions, getEditColumn, getEditColumnActions, getEditController, getEditRowActions, getModel, getMultiColumnRuleCount, getNoRowsRenderer, getRowCount, getRowHeader, getRowModel, getRowRenderer, getRowSelectionColumn, getRowsToDelete, getUncommittedValues, gotoRow, initialize, initializeColumnNumbers, initializeRowNumbers, insert, isAccurateRowCountAvailable, isAutoCommit, isCancelSupported, isCellIdsGenerated, isColumnMoveAllowed, isCommitSupported, isCurrentValueToEncode, isDeleteSupported, isExportNumericCustomFormattedValuesAsText, isGotoColumnSupported, isGotoRowSupported, isInsertSupported, isPromptOnDelete, isUpdateSupported, lastRow, moveColumn, removeColumn, resetColumnHeaderActions, resetDataCellActions, resetEditColumnActions, resetEditRowActions, setAutoCreateColumnsFromModel, setCellEditor, setCellEditor, setCellEditor, setCellIdsGenerated, setCellRenderer, setCellRenderer, setCellRenderer, setColumnHeader, setColumnHeaderAreaRenderer, setColumnModel, setCurrentColumn, setCurrentRow, setEditColumn, setEditController, setLocale, setModel, setNoRowsRenderer, setRowHeader, setRowModel, setRowRenderer, setRowRenderer, setRowSelectionColumn, setRowsToDelete, setUncommittedValues, tableChanged, update, write, writeContent, writeRow, writeRow, writeRow
 
Methods inherited from class com.sas.servlet.tbeans.tableview.AbstractBaseTableView
addFeature, addMoveMenu, firstColumn, firstRow, getBorderWidth, getCaption, getCellPadding, getCellSpacing, getColumnPageSize, getEndColumn, getEndRow, getFormName, getHorizontalAlignment, getRowPageSize, getRulesContext, getStartColumn, getStartRow, getStyleMap, getSummary, getTextWrapping, getWidth, getWidthPercentage, gotoColumn, isAllActionsVisible, isColumnHeaderVisible, isColumnsResizable, isFirstColumnSupported, isFirstRowSupported, isLastColumnSupported, isLastRowSupported, isNextColumnSupported, isNextRowSupported, isPageBackwardColumnsSupported, isPageBackwardRowsSupported, isPageForwardColumnsSupported, isPageForwardRowsSupported, isPreviousColumnSupported, isPreviousRowSupported, isRowHeaderVisible, lastColumn, nextColumn, nextRow, pageBackwardColumns, pageBackwardRows, pageForwardColumns, pageForwardRows, previousColumn, previousRow, removeLastBorder, setAllActionsVisible, setBorderWidth, setCaption, setCellPadding, setCellSpacing, setColumnHeaderVisible, setColumnPageSize, setColumnsResizable, setEndColumn, setEndRow, setHorizontalAlignment, setPageSize, setRowHeaderVisible, setRowPageSize, setRulesContext, setStartColumn, setStartRow, setSummary, setTextWrapping, setWidth, setWidthPercentage, writeColumnHeader, writeColumnHeader, writeEmptyTable, writeEmptyTable, writeFeatures, writeRows, writeRows, writeTableFooter, writeTableFooter, writeTableHeader, writeTableHeader, writeTableTFoot
 
Methods inherited from class com.sas.servlet.tbeans.BaseActionTransformation
dispose, getActionProvider, getActionSupportType, getUniqueId, isActionVisible, listActionTypes, listAreaTypes, setActionProvider, setActionSupportType, setActionVisible, setUniqueId
 
Methods inherited from class com.sas.servlet.tbeans.BaseTransformation
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getCustomAttributes, getDescription, getId, getInputTransform, getLocale, getName, getObjectData, getObjectDataProperty, getOutputTransform, getRequest, getResponse, getTagEpilog, getTagProlog, hasListeners, isCleanUpResourcesOn, isVisible, removePropertyChangeListener, removePropertyChangeListener, setCleanUpResourcesOn, setCustomAttributes, setDescription, setId, setInputTransform, setLocaleDependentProperties, setName, setObjectData, setObjectDataProperty, setOutputTransform, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, toString, write, write, write
 
Methods inherited from interface com.sas.actionprovider.URLTemplateViewInterface
getURLTemplate, setURLTemplate
 
Methods inherited from interface com.sas.servlet.tbeans.TransformationInterface
getCustomAttributes, getDescription, getId, getLocale, getName, getRequest, getResponse, getTagEpilog, getTagProlog, isVisible, setCustomAttributes, setDescription, setId, setName, setRequest, setResponse, setTagEpilog, setTagProlog, setVisible, write, write, write
 
Methods inherited from interface com.sas.actionprovider.HttpActionProviderViewInterface
getRequest, setRequest
 

Constructor Detail

TableView

public TableView()
Constructs a new default TableView with a null data model, a null column model and a null row model.


TableView

public TableView(javax.swing.table.TableModel tableModel)
Constructs a TableView that is initialized with tableModel as the data model, a default column model, and a default row model.

Parameters:
tableModel - the data model for the table

TableView

public TableView(javax.swing.table.TableModel tableModel,
                 TableColumnModel columnModel)
Constructs a TableView that is initialized with tableModel as the data model and columnModel as the column model, and a default row model.

Parameters:
tableModel - the data model for the table
columnModel - the column model for the table

TableView

public TableView(javax.swing.table.TableModel tm,
                 TableColumnModel cm,
                 TableRowModel rm)
Constructs a TableView that is initialized with tableModel as the data model, columnModel as the column model and rowModel as the row model. The autoCreateColumnsFromModel flag is set to false if column model passed in is non-null, otherwise it is set to true and the column model is populated with suitable TableColumns for the columns in the data model.

Parameters:
tableModel - the data model for the table
columnModel - the column model for the table
rowModel - the row model for the table

TableView

public TableView(int numRows,
                 int numColumns)
Constructs a TableView with numRows and numColumns of empty cells using DefaultTableModel. It also creates a default column model. The columns will have names of the form "A", "B", "C", etc.

Parameters:
numRows - the number of rows the table holds
numColumns - the number of columns the table holds
See Also:
DefaultTableModel

TableView

public TableView(java.lang.Object[][] rowData,
                 java.lang.Object[] columnNames)

Constructs a TableView to display the values in the two dimensional array, rowData, with column names, columnNames. The rowData is an array of rows, so the value of the cell at row 1, column 5 can be obtained with the following code:

 rowData[1][5]; 

All rows must be of the same length as columnNames.

Parameters:
rowData - the data for the new table
columnNames - names of each column

TableView

public TableView(java.util.Vector rowData,
                 java.util.Vector columnNames)
Constructs a TableView to display the values in the Vector of Vectors, rowData, with column names, columnNames. The Vectors contained in rowData should contain the values for that row. In other words, the value of the cell at row 1, column 5 can be obtained with the following code:

((Vector)rowData.elementAt(1)).elementAt(5);

Each row must contain a value for each column or an exception will be raised.

Parameters:
rowData - the data for the new table
columnNames - names of each column
Method Detail

setTitle

public void setTitle(java.lang.String value)
Sets the title of the table.

Overrides:
setTitle in class AbstractBaseTableView
Parameters:
value - The title of the table

getTitle

public java.lang.String getTitle()
Gets the title of the table.

Overrides:
getTitle in class AbstractBaseTableView
Returns:
the title of the table.

getDefaultColumnModel

public TableColumnModel getDefaultColumnModel()
Returns the default column model for the TableView. If the data model is not set then the default column model will have a size of zero.

Specified by:
getDefaultColumnModel in class BaseTableView
Returns:
the default column model for the TableView

getDefaultRowModel

public TableRowModel getDefaultRowModel()
Returns the default row model for the TableView.

Specified by:
getDefaultRowModel in class BaseTableView
Returns:
the default row model for the TableView

getDefaultColumnHeader

public BaseColumnHeader getDefaultColumnHeader()
Returns the default columnHeader for the TableView.

Specified by:
getDefaultColumnHeader in class BaseTableView
Returns:
the default columnHeader for the TableView

getDefaultRowHeader

public BaseRowHeader getDefaultRowHeader()
Returns the default rowHeader for the TableView.

Specified by:
getDefaultRowHeader in class BaseTableView
Returns:
the default rowHeader for the TableView

getDefaultRenderer

public TableCellRenderer getDefaultRenderer()
Gets the default cell renderer for the TableView.

Specified by:
getDefaultRenderer in class BaseTableView
Returns:
an instance of the TableCellRenderer

setDefaultRenderer

public void setDefaultRenderer(TableCellRenderer renderer)
Sets the default cell renderer for the TableView.

Parameters:
renderer - the default cell renderer for the TableView

getDefaultEditor

public TableCellEditor getDefaultEditor()
Editing not implemented on this class, returns null.

Specified by:
getDefaultEditor in class BaseTableView
Returns:
null, editing not implemented

getDefaultColumnHeaderRowRenderer

public TableRowRenderer getDefaultColumnHeaderRowRenderer()
Gets the default row renderer for the TableView's column header row.

Specified by:
getDefaultColumnHeaderRowRenderer in class BaseTableView
Returns:
an instance of the TableRowRenderer

setDefaultColumnHeaderRowRenderer

public void setDefaultColumnHeaderRowRenderer(TableRowRenderer renderer)
Sets the default row renderer for the TableView's column header row.

Parameters:
renderer - the default row renderer for the TableView's column header row

getDefaultRowRenderer

public TableRowRenderer getDefaultRowRenderer()
Gets the default row renderer for the TableView.

Specified by:
getDefaultRowRenderer in class BaseTableView
Returns:
an instance of the TableRowRenderer

setDefaultRowRenderer

public void setDefaultRowRenderer(TableRowRenderer renderer)
Sets the default row renderer for the TableView.

Parameters:
renderer - the default row renderer for the TableView

getDefaultNoRowsRenderer

public TableCellContentsRenderer getDefaultNoRowsRenderer()
Gets the default noRows cell content renderer for the TableView. This renderer is used when there are no rows in the data model.

Specified by:
getDefaultNoRowsRenderer in class BaseTableView
Returns:
an instance of the TableCellContentsRenderer

writeTableHeader

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

Specified by:
writeTableHeader in class AbstractBaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeColumnHeader

public void writeColumnHeader(java.io.PrintWriter out)
                       throws java.io.IOException
Writes the headerValue for each column in the column model. If the column's headerValue is null then the column name from the dataModel is used.

Overrides:
writeColumnHeader in class BaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeRows

protected void writeRows(java.io.PrintWriter out)
                  throws java.io.IOException
Writes the rows of data for the tableview. This method will also write out the rowHeaders for each row. This method calls writeRow() for each row in the TableView's data model.

Overrides:
writeRows in class BaseTableView
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeTableFooter

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

Specified by:
writeTableFooter in class AbstractBaseTableView
Parameters:
out - the output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

writeEmptyTable

public void writeEmptyTable(java.io.PrintWriter out)
                     throws java.io.IOException
Writes an empty table when a data model in not attached or the data model has no rows in it. The method makes use of the no rows renderer.

Specified by:
writeEmptyTable in class AbstractBaseTableView
Parameters:
out - The output stream
Throws:
java.io.IOException - Thrown if some type of I/O error occurs

getDefaultEditController

public HttpEditController getDefaultEditController()
Method not implemented, returns null.

Specified by:
getDefaultEditController in class BaseTableView
Returns:
null, method not implemented
See Also:
HttpEditController

getDefaultRowSelectionColumn

public TableColumn getDefaultRowSelectionColumn()
Method not implemented, returns null.

Specified by:
getDefaultRowSelectionColumn in class BaseTableView
Returns:
null, method not implemented
See Also:
BaseTableView.setRowSelectionMode(int), BaseTableView.getRowSelectionMode()

getDefaultEditColumn

public TableColumn getDefaultEditColumn()
Method not implemented, returns null.

Specified by:
getDefaultEditColumn in class BaseTableView
Returns:
null, method not implemented



Copyright © 2009 SAS Institute Inc. All Rights Reserved.