public class SpreadsheetTableModel extends AbstractTableModel
listenerList
Constructor and Description |
---|
SpreadsheetTableModel(Spreadsheet spreadsheet,
UIController uiController)
Creates a spreadsheet table model.
|
Modifier and Type | Method and Description |
---|---|
Class<?> |
getColumnClass(int column)
Returns
Cell.class for all columns. |
int |
getColumnCount() |
int |
getRowCount() |
Spreadsheet |
getSpreadsheet()
Returns the spreadsheet that provides the data.
|
Object |
getValueAt(int row,
int column)
Returns the cell at the given row and column in the spreadsheet.
|
boolean |
isCellEditable(int row,
int column)
Overridden to allow editing of the table.
|
void |
setValueAt(Object value,
int row,
int column)
Implemented as a no-op, since the table's
CellEditor
instance updates the content of cells. |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
public SpreadsheetTableModel(Spreadsheet spreadsheet, UIController uiController)
spreadsheet
- the spreadsheet that provides the datauiController
- the user interface controllerpublic Class<?> getColumnClass(int column)
Cell.class
for all columns.getColumnClass
in interface TableModel
getColumnClass
in class AbstractTableModel
column
- the column whose data type is requestedCell.class
public int getRowCount()
public int getColumnCount()
public Spreadsheet getSpreadsheet()
public Object getValueAt(int row, int column)
row
- the row index of the cell being requestedcolumn
- the column index of the cell being requestedSpreadsheet.getCell(Address)
public void setValueAt(Object value, int row, int column)
CellEditor
instance updates the content of cells.setValueAt
in interface TableModel
setValueAt
in class AbstractTableModel
value
- the value to setrow
- the row index of the cell to changecolumn
- the column index of the cell to changeCell.setContent(String)
public boolean isCellEditable(int row, int column)
isCellEditable
in interface TableModel
isCellEditable
in class AbstractTableModel
row
- the row whose value is to be queriedcolumn
- the column whose value is to be queried