|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
com.wordpress.tipsforjava.swing.table.RowTableModel
com.wordpress.tipsforjava.swing.table.ListTableModel
public class ListTableModel extends RowTableModel
| Field Summary |
|---|
| Fields inherited from class RowTableModel | |
|---|---|
| columnClasses, columnNames, isColumnEditable, isModelEditable, modelData, rowClass |
| Constructor Summary | |
ListTableModel(int columns)
Constructs an empty |
|
ListTableModel(List columnNames)
Constructs an empty |
|
ListTableModel(int rows, int columns)
Constructs a |
|
ListTableModel(List modelData, List columnNames)
Constructs a |
|
| Method Summary | |
|---|---|
void
|
addRow(Object[] rowData)
Adds a row of data to the end of the model. |
private List
|
copyToList(Object[] rowData)
|
static ListTableModel
|
createModelFromResultSet(ResultSet resultSet)
Create a ListTableModel given a specific ResultSet. |
Object
|
getValueAt(int row, int column)
Returns an attribute value for the cell at |
void
|
insertRow(int row, List rowData)
Insert a row of data at the |
void
|
insertRow(int row, Object[] rowData)
Insert a row of data at the |
void
|
insertRows(int row, List rowList)
Insert multiple rows of data at the |
void
|
insertRows(int row, Object[] rowArray)
Insert multiple rows of data at the |
private void
|
justifyRow(List rowData)
|
protected static List
|
newList(int size)
Initialize the List with null values. |
void
|
setValueAt(Object value, int row, int column)
Sets the object value for the cell at |
| Methods inherited from class RowTableModel | |
|---|---|
| addRow, formatColumnName, getColumnClass, getColumnCount, getColumnName, getRow, getRowCount, getRowsAsArray, getRowsAsList, insertRow, insertRows, insertRows, isCellEditable, moveRow, removeRowRange, removeRows, replaceRow, setColumnClass, setColumnEditable, setDataAndColumnNames, setModelEditable, setRowClass |
| Constructor Detail |
|---|
public ListTableModel(int columns)
ListTableModel with default
column names for the specified number of columns.
columns - the number of columns the table holds
public ListTableModel(List columnNames)
ListTableModel with customized
column names. The number of columns is determined bye the
number of items in the columnNames List.
columnNames - List containing the names
of the new columns
public ListTableModel(int rows, int columns)
ListTableModel with the specified number
of rows. Default column names will be used for the specified number
of columns.
rows the - number of initially empty rows to createcolumns - the number of columns the table holds
public ListTableModel(List modelData, List columnNames)
ListTableModel with initial data and
customized column names.
Each item in the modelData List must also be a List Object
containing items for each column of the row.
Each column's name will be taken from the columnNames
List and the number of colums is determined by thenumber of items
in the columnNames List.
modelData - the data of the tablecolumnNames - List containing the names
of the new columns
| Method Detail |
|---|
public void addRow(Object[] rowData)
rowData - data of the row being added
private List copyToList(Object[] rowData)
public static ListTableModel createModelFromResultSet(ResultSet resultSet)
resultSet - ResultSet containing results of a database query
public Object getValueAt(int row, int column)
row
and column.
row the - row whose value is to be queriedcolumn - the column whose value is to be queried
de public public void insertRow(int row, List rowData)
row location in the model.
Notification of the row being added will be generated.
row - row in the model where the data will be insertedrowData - data of the row being added
public void insertRow(int row, Object[] rowData)
row location in the model.
Notification of the row being added will be generated.
row - row in the model where the data will be insertedrowData - data of the row being added
de public public void insertRows(int row, List rowList)
row location in the model.
Notification of the row being added will be generated.
row - row in the model where the data will be insertedrowList - each item in the list is a separate row of data
public void insertRows(int row, Object[] rowArray)
row location in the model.
Notification of the row being added will be generated.
row - row in the model where the data will be insertedrowArray - each item in the Array is a separate row of data
ssWarnings("unchecked")
private
private void justifyRow(List rowData)
protected static List newList(int size)
size - the number of Elements to add to the List
ssWarnings("unchecked")
public
public void setValueAt(Object value, int row, int column)
column and
row. value is the new value. This method
will generate a tableChanged notification.
value - the new value; this can be nullrow - the row whose value is to be changedcolumn - the column whose value is to be changed
Groovy Documentation