|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.servlet.tbeans.tableview.html.TableView
public class TableView
The TableView is a TransformationBean that generates the appropriate HTML 4.0 and JavaScript to represent a table of data from the given 2-dimensional model.
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.
The TableView is one of several TransformationBeans that rely on a set of style classes that are used by default when generating the resulting markup language. For more information on style sheets and the default style classes that apply to this TransformationBean, refer to the AppDev Studio Developer Site. You'll find a useful reference document entitled Cascading Style Sheets, Images, and TransformationBeans as well as the TransformationBeans Style Sheet Reference.
The TableView is one of several TransformationBeans that rely on JavaScript to provide some of its functionality. These JavaScript files are including automatically by the tbean. See JavaScriptIncludeHandler for more information about how these files are included and how to customize this behavior. The TableView uses the following JavaScript files:
Note that the toString() method on this class calls the write
method, which may have undesirable side effects. See BaseTransformation.toString() for more information. Debuggers often use toString() to show the value of a variable, and this may cause unexpected behavior while debugging
For More Information:
Visit the AppDev Studio Developer's Site to access step-by-step examples, white papers and additional usage information at http://support.sas.com/rnd/appdev/.
Examples for this class may be found on the Examples Site.
JSP custom tags provide an alternative to using the TransformationBeans. Visit the Custom Tag Library Reference for additional information on the sas:TableView custom tag.
Note: A snapshot of the AppDev Studio Developers Site is installed on your local Web server when you install AppDev Studio. To access the site from webAF, select Help -> Developer Site .
TableViewComposite
,
BaseTableView
,
Serialized FormField Summary |
---|
Fields inherited from class com.sas.servlet.tbeans.tableview.BaseTableView |
---|
columnsToExportAsTextIfCustomFormatted, EDITROW, LASTROW |
Fields inherited from class com.sas.servlet.tbeans.tableview.AbstractBaseTableView |
---|
DEFAULT_EXPORT_NUMERIC_CUSTOM_FORMATED_VALUES_AS_TEXT, WRAP_ALL, WRAP_NONE, WRAP_PER_COLUMN |
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 | |
---|---|
java.util.HashMap |
getAdditionalParameters()
Returns an HashMap containing additional parameters that should be added to the form used to perform the various actions on the TableView. |
int |
getColSpanAll()
|
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()
Returns the default instance of TableColumn to use as the column, independent of the data, which contains the edit actions. |
HttpEditController |
getDefaultEditController()
Returns the default edit controller. |
TableCellEditor |
getDefaultEditor()
Gets the default cell editor for the TableView. |
Form |
getDefaultFormObject()
Gets the default form object to be used by the TableView. |
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()
Returns the default instance of TableColumn to use as the column, independent of the data, that can be used to select rows in the TableView. |
Form |
getFormObject()
Gets the form object to be used by the TableView. |
boolean |
isFormEnabled()
Determines if the TableView should render its formObject. |
void |
setAdditionalParameter(java.lang.String name,
java.lang.String value)
Sets an additional parameter to be added to the form used to perform the various actions on the TableView. |
void |
setAdditionalParameters(java.util.HashMap map)
Sets an HashMap containing additional parameters that should be added to the form used to perform the various actions on the TableView. |
void |
setDefaultColumnHeaderRowRenderer(TableRowRenderer renderer)
Sets the default row renderer for the TableView's column header row. |
void |
setDefaultEditor(TableCellEditor editor)
Sets the default cell editor for the TableView. |
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 |
setFormEnabled(boolean enable)
Sets whether the TableView should render its formObject. |
void |
setFormObject(Form form)
Sets the form object to be used by the TableView. |
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 end tag for the tableview. |
void |
writeTableHeader(java.io.PrintWriter out)
Writes the header tag and all its attributes for tableview. |
void |
writeTableTFoot(java.io.PrintWriter out)
Writes the tfoot section of the table |
Methods inherited from class com.sas.servlet.tbeans.BaseActionTransformation |
---|
dispose, getActionProvider, getActionSupportType, getUniqueId, isActionVisible, listActionTypes, listAreaTypes, setActionProvider, setActionSupportType, setActionVisible, setUniqueId |
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 |
---|
public TableView()
public TableView(javax.swing.table.TableModel tableModel)
tableModel
- the data model for the tablepublic TableView(javax.swing.table.TableModel tableModel, TableColumnModel columnModel)
tableModel
- the data model for the tablecolumnModel
- the column model for the tablepublic TableView(javax.swing.table.TableModel tm, TableColumnModel cm, TableRowModel rm)
tableModel
- the data model for the tablecolumnModel
- the column model for the tablerowModel
- the row model for the tablepublic TableView(int numRows, int numColumns)
numRows
- the number of rows the table holdsnumColumns
- the number of columns the table holdsDefaultTableModel
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
.
rowData
- the data for the new tablecolumnNames
- names of each columnpublic TableView(java.util.Vector rowData, java.util.Vector columnNames)
((Vector)rowData.elementAt(1)).elementAt(5);
Each row must contain a value for each column or an exception will be raised.
rowData
- the data for the new tablecolumnNames
- names of each columnMethod Detail |
---|
public TableColumnModel getDefaultColumnModel()
getDefaultColumnModel
in class BaseTableView
public TableRowModel getDefaultRowModel()
getDefaultRowModel
in class BaseTableView
public BaseColumnHeader getDefaultColumnHeader()
getDefaultColumnHeader
in class BaseTableView
public BaseRowHeader getDefaultRowHeader()
getDefaultRowHeader
in class BaseTableView
public void setFormObject(Form form)
setFormObject
in interface FormViewInterface
form
- The form objectpublic Form getFormObject()
getFormObject
in interface FormViewInterface
public Form getDefaultFormObject()
getDefaultFormObject
in interface FormViewInterface
public java.util.HashMap getAdditionalParameters()
getAdditionalParameters
in interface FormViewInterface
HashMap
public void setAdditionalParameters(java.util.HashMap map)
setAdditionalParameters
in interface FormViewInterface
map
- HashMap objectHashMap
public void setAdditionalParameter(java.lang.String name, java.lang.String value)
setAdditionalParameter
in interface FormViewInterface
name
- name of the list itemvalue
- value of the list itemHashMap
public void setFormEnabled(boolean enable)
setFormEnabled
in interface FormViewInterface
value
- true if the formObject should be rendered by the tbeanpublic boolean isFormEnabled()
isFormEnabled
in interface FormViewInterface
public TableCellRenderer getDefaultRenderer()
getDefaultRenderer
in class BaseTableView
public void setDefaultRenderer(TableCellRenderer renderer)
renderer
- the default cell renderer for the TableViewpublic TableCellEditor getDefaultEditor()
getDefaultEditor
in class BaseTableView
public void setDefaultEditor(TableCellEditor editor)
renderer
- the default cell editor for the TableViewpublic TableRowRenderer getDefaultColumnHeaderRowRenderer()
getDefaultColumnHeaderRowRenderer
in class BaseTableView
public void setDefaultColumnHeaderRowRenderer(TableRowRenderer renderer)
renderer
- the default row renderer for the TableView's column
header rowpublic TableRowRenderer getDefaultRowRenderer()
getDefaultRowRenderer
in class BaseTableView
public void setDefaultRowRenderer(TableRowRenderer renderer)
renderer
- the default row renderer for the TableViewpublic TableCellContentsRenderer getDefaultNoRowsRenderer()
getDefaultNoRowsRenderer
in class BaseTableView
public void writeTableHeader(java.io.PrintWriter out) throws java.io.IOException
writeTableHeader
in class AbstractBaseTableView
out
- the output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic int getColSpanAll()
getColSpanAll
in class AbstractBaseTableView
public void writeColumnHeader(java.io.PrintWriter out) throws java.io.IOException
writeColumnHeader
in class BaseTableView
out
- the output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void writeTableTFoot(java.io.PrintWriter out) throws java.io.IOException
writeTableTFoot
in class AbstractBaseTableView
out
- the output stream
java.io.IOException
- Thrown if some type of I/O error occursprotected void writeRows(java.io.PrintWriter out) throws java.io.IOException
writeRows
in class BaseTableView
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void writeTableFooter(java.io.PrintWriter out) throws java.io.IOException
writeTableFooter
in class AbstractBaseTableView
out
- the output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic void writeEmptyTable(java.io.PrintWriter out) throws java.io.IOException
writeEmptyTable
in class AbstractBaseTableView
out
- The output stream
java.io.IOException
- Thrown if some type of I/O error occurspublic HttpEditController getDefaultEditController()
getDefaultEditController
in class BaseTableView
EditControllerInterface
public TableColumn getDefaultRowSelectionColumn()
Returns the default instance of TableColumn to use as the column, independent of the data, that can be used to select rows in the TableView. This column can be added to the ColumnModel. If the rowSelectionColumn is visible and the rowSelectionColumn is not in the ColumnModel, then the rowSelectionColumn will be displayed automatically before the data columns. If the rowSelectionColumn has been added to the ColumnModel then the rowSelectionColumn will be displayed only at the locations specified in the ColumnModel, as long as the rowSelectionColumn is visible. The following attributes will be set on the returned TableColumn:
identifier: "TABLEVIEW_ROW_SELECTION"
headerValue: ""
modelIndex: -1
cellRenderer: new RowSelectionRenderer()
getDefaultRowSelectionColumn
in class BaseTableView
BaseTableView.setRowSelectionMode(int)
,
BaseTableView.getRowSelectionMode()
public TableColumn getDefaultEditColumn()
Returns the default instance of TableColumn to use as the column, independent of the data, which contains the edit actions. This column can be added to the ColumnModel. If the editing is enabled and the editColumn is not in the ColumnModel, then the editColumn will be displayed automatically before the data columns. If the editColumn has been added to the ColumnModel, then the editColumn will be displayed only at the locations specified in the ColumnModel, as long as editing is enabled. The following attributes will be set on the returned TableColumn:
identifier: "TABLEVIEW_EDIT_COLUMN"
headerValue: ""
modelIndex: -1
getDefaultEditColumn
in class BaseTableView
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |