class org.aswing.table.AbstractTableModel

This abstract class provides default implementations for most of the methods in the TableModel interface. It takes care of the management of listeners and provides some conveniences for generating TableModelEvents and dispatching them to the listeners. To create a concrete TableModel as a subclass of AbstractTableModel you need only provide implementations for the following three methods:

public function getRowCount():Number;
public function getColumnCount():Number;
public function getValueAt(row:Number, column:Number);

Authors

  • paling

Instance Fields

function new(): Void

function addTableModelListener(l:TableModelListener): Void

Adds a listener to the list that's notified each time a change to the data model occurs.

l

the TableModelListener

function findColumn(columnName:String): Int

Returns a column given its name. Implementation is naive so this should be overridden if this method is to be called often. This method is not in the TableModel interface and is not used by the JTable.

columnName

string containing name of column to be located

returns

the column with columnName, or -1 if not found

function getColumnClass(columnIndex:Int): String

Returns class name regardless of columnIndex.

columnIndex

the column being queried

returns

the class name, default is "Object"

function getColumnCount(): Int

Subclass must override this method.

function getColumnName(column:Int): String

Returns a default name for the column using spreadsheet conventions: A, B, C, ... Z, AA, AB, etc. If column cannot be found, returns an empty string.

column

the column being queried

returns

a string containing the default name of column

function getRowCount(): Int

Subclass must override this method.

function getTableModelListeners(): Array<Dynamic>

Returns an array of all the table model listeners registered on this model.

returns

all of this model's TableModelListeners or an empty array if no table model listeners are currently registered

function getValueAt(rowIndex:Int, columnIndex:Int): Dynamic

Subclass must override this method.

function isCellEditable(rowIndex:Int, columnIndex:Int): Bool

Returns false. This is the default implementation for all cells.

@param rowIndex the row being queried @param columnIndex the column being queried @return false

function removeTableModelListener(l:TableModelListener): Void

Removes a listener from the list that's notified each time a change to the data model occurs.

l

the TableModelListener

function setColumnClass(columnIndex:Int, className:String): Void

Sets class name regardless of columnIndex.

columnIndex

the column being queried

className

the class name

function setValueAt(aValue:Dynamic, rowIndex:Int, columnIndex:Int): Void

This empty implementation is provided so users don't have to implement this method if their data model is not editable.

@param aValue value to assign to cell @param rowIndex row of cell @param columnIndex column of cell

function toString(): String