| java.lang.Object org.jaffa.presentation.portlet.widgets.model.WidgetModel org.jaffa.presentation.portlet.widgets.model.TableModel
TableModel | public class TableModel extends WidgetModel (Code) | | Model for the Table widget.
|
Inner Class :public class Column | |
Method Summary | |
public void | addColumn(String name, String dataType) Add a column to the Table. | public void | addRow(List fields) Add a row to the table. | public void | addRow(int position, List fields) Add a row to the table. | public void | clearColumns() | public void | clearRows() | public String | getColumnDataType(String columnName) Returns the dataType for the columnName. | public List | getColumnNames() Returns a List of columnNames, in the order of entry. | public List | getColumns() Returns a List of TableModel.Column objects, in the order of entry. | public List | getRow(int rowNum) Returns a List of field values in column order for the input row number.
An IndexOutOfBoundsException will be thrown in case the rowNum is senseless.
Parameters: rowNum - The index of the row to be retrieved. | public List | getRows() Returns a Collection, where each element is a List of fields, in the order of the columns. | public List | getSelectedRows() Returns a List of selected rows, where each row is a List of field values. | public Object | getValue(String columnName, int rowNum) Return a field value from a given row.
A null will be returned in case the columnName does not exist
An IndexOutOfBoundsException will be thrown in case the rowNum is senseless.
Parameters: columnName - The name of the column. Parameters: rowNum - The index of the row to be retrieved. | public boolean | isModelChanged() See if model has changed, in the process reset the changed flag. | public void | setSelectedRows(List rowNums) Sets the selected rows. |
addColumn | public void addColumn(String name, String dataType)(Code) | | Add a column to the Table. An exisiting column by the same name will be over-written.
Parameters: name - The name of the column. Parameters: dataType - The data type of the column. |
addRow | public void addRow(List fields)(Code) | | Add a row to the table. A ColumnMismatchRuntimeException is thrown if the no. of fields does not equal the no. of columns.
Parameters: fields - The List of values. |
addRow | public void addRow(int position, List fields)(Code) | | Add a row to the table. A ColumnMismatchRuntimeException is thrown if the no. of fields does not equal the no. of columns.
Parameters: position - The index of the row. Parameters: fields - The List of values. |
clearColumns | public void clearColumns()(Code) | | Clear out all the columns
|
clearRows | public void clearRows()(Code) | | Clear out all the rows
|
getColumnDataType | public String getColumnDataType(String columnName)(Code) | | Returns the dataType for the columnName. A null will be returned in case no such column exists.
Parameters: columnName - The name of the column. the dataType for the column. |
getColumnNames | public List getColumnNames()(Code) | | Returns a List of columnNames, in the order of entry.
a List of columnNames, in the order of entry. |
getColumns | public List getColumns()(Code) | | Returns a List of TableModel.Column objects, in the order of entry.
a List of TableModel.Column objects, in the order of entry. |
getRow | public List getRow(int rowNum)(Code) | | Returns a List of field values in column order for the input row number.
An IndexOutOfBoundsException will be thrown in case the rowNum is senseless.
Parameters: rowNum - The index of the row to be retrieved. a List of field values in column order for the input row number. |
getRows | public List getRows()(Code) | | Returns a Collection, where each element is a List of fields, in the order of the columns.
a Collection, where each element is a List of fields, in the order of the columns. |
getSelectedRows | public List getSelectedRows()(Code) | | Returns a List of selected rows, where each row is a List of field values.
a List of selected rows, where each row is a List of field values. |
getValue | public Object getValue(String columnName, int rowNum)(Code) | | Return a field value from a given row.
A null will be returned in case the columnName does not exist
An IndexOutOfBoundsException will be thrown in case the rowNum is senseless.
Parameters: columnName - The name of the column. Parameters: rowNum - The index of the row to be retrieved. a field value from a given row. |
isModelChanged | public boolean isModelChanged()(Code) | | See if model has changed, in the process reset the changed flag.
true if the model was changed. |
setSelectedRows | public void setSelectedRows(List rowNums)(Code) | | Sets the selected rows. This will first reset the selected status of all rows.
Parameters: rowNums - A List of row numbers to be marked as selected. |
|
|