|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel ix.iface.ui.table.AbstractIXTableModel
public abstract class AbstractIXTableModel
An abstract class for table models. Keeps track of the base objects that are shown in the table. Implements most functions required by JTable and IXTable objects to work. Implement the following functions (see documentation below):
Nested Class Summary | |
---|---|
static interface |
AbstractIXTableModel.TableMarkListener
|
Field Summary | |
---|---|
protected java.util.ArrayList |
columnClasses
|
protected java.util.ArrayList |
columnFields
|
protected java.util.ArrayList |
columnNames
|
protected java.util.HashSet |
markedRows
contains data objects. cannot do rows because it gets confused with expand/collapse in tree tables! |
protected java.lang.Class |
objectClass
|
protected java.util.List |
rows
a list of objects that appear in the table |
protected boolean |
rowsMarkable
|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
AbstractIXTableModel(boolean markable)
Makes an empty model. |
|
AbstractIXTableModel(boolean markable,
java.lang.Class theClass,
java.lang.Object[] theRows)
Makes a model that contains the given nodes and derives which fields to use. |
|
AbstractIXTableModel(boolean markable,
java.lang.Object[] theRows)
Makes a model that contains the given nodes. |
|
AbstractIXTableModel(boolean markable,
java.lang.Object[] theRows,
java.lang.String[] columns)
Makes a model as above but with the given strings as column names. |
Method Summary | |
---|---|
void |
addData(int row,
java.lang.Object data)
Adds the given data object to the table's rows at the given position if it is not already there and notifies listeners. |
void |
addData(java.lang.Object data)
Adds the given data object to the table's rows if it is not already there and notifies listeners. |
void |
addMarkListener(AbstractIXTableModel.TableMarkListener tml)
|
void |
clearData()
Removes all data objects from the table's rows and notifies listeners. |
void |
clearMarks()
|
protected java.lang.Object |
defaultGetCellValueAt(java.lang.Object o,
int columnIndex)
Looks up the value in the columnField of the given index. |
protected void |
defaultSetColumnFields(java.lang.String[] fieldNames)
Sets the fields to be used as table columns |
protected void |
deriveColumnFields()
Collects usable fields from the objectClass |
void |
fireTableMarkAdded(java.lang.Object rowObject)
|
void |
fireTableMarkCleared()
|
void |
fireTableMarkedAll()
|
void |
fireTableMarkRemoved(java.lang.Object rowObject)
|
abstract java.lang.Object |
getCellValueAt(java.lang.Object baseObject,
int columnIndex)
Gets the object's value for the given column index. |
java.lang.Class |
getColumnClass(int index)
JTable required TableModel function (default is Object). |
int |
getColumnCount()
JTable required TableModel function. |
java.lang.String |
getColumnName(int index)
JTable required TableModel function. |
protected java.lang.String[] |
getColumnNames()
Gets the strings to use as column names. |
java.util.List |
getData()
|
java.util.Collection |
getMarkedObjects()
|
java.util.Collection |
getMarkedRows()
|
int |
getObjectRow(java.lang.Object object)
Gets the row index of the given object |
int |
getRowCount()
JTable required TableModel function. |
java.lang.Object |
getRowObject(int rowIndex)
Gets the object that is in the given row. |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex)
Gets the value for a cell in the table defined by the given indices. |
boolean |
isCellEditable(int row,
int col)
|
boolean |
isMarkable()
|
boolean |
isMarked(int row)
|
boolean |
isMarkedEmpty()
|
void |
markAll()
|
void |
markRow(int row)
|
void |
removeData(java.lang.Object data)
Removes the given data object from the table's rows and notifies listeners if it worked. |
void |
removeMarkListener(AbstractIXTableModel.TableMarkListener tml)
|
void |
replaceData(java.lang.Object oldData,
java.lang.Object newData)
Replaces the given old data object with the new given one and notifies listeners if it worked. |
void |
setColumnClasses(java.lang.Class[] fieldClasses)
Sets the column classes of the table |
void |
setColumnFields(java.lang.Class objectClass,
java.lang.String[] fieldNames)
Sets the fields to be used as columns in the table |
void |
setColumnNames(java.lang.String[] fieldNames)
Sets the column titles to be used in the table |
void |
setData(java.lang.Object[] data)
Sets the table's rows to the given data objects and notifies listeners. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
|
void |
unmarkRow(int row)
|
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.ArrayList columnFields
protected java.util.ArrayList columnNames
protected java.util.ArrayList columnClasses
protected java.lang.Class objectClass
protected boolean rowsMarkable
protected java.util.HashSet markedRows
protected java.util.List rows
Constructor Detail |
---|
public AbstractIXTableModel(boolean markable)
public AbstractIXTableModel(boolean markable, java.lang.Object[] theRows)
public AbstractIXTableModel(boolean markable, java.lang.Object[] theRows, java.lang.String[] columns)
public AbstractIXTableModel(boolean markable, java.lang.Class theClass, java.lang.Object[] theRows)
Method Detail |
---|
public void setData(java.lang.Object[] data)
public java.util.List getData()
public void addData(java.lang.Object data)
public void addData(int row, java.lang.Object data)
public void removeData(java.lang.Object data)
public void replaceData(java.lang.Object oldData, java.lang.Object newData)
public void clearData()
public java.lang.Object getRowObject(int rowIndex)
public int getObjectRow(java.lang.Object object)
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
public int getRowCount()
public int getColumnCount()
public java.lang.String getColumnName(int index)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public java.lang.Class getColumnClass(int index)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public abstract java.lang.Object getCellValueAt(java.lang.Object baseObject, int columnIndex)
public boolean isCellEditable(int row, int col)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
public void setColumnNames(java.lang.String[] fieldNames)
public void setColumnClasses(java.lang.Class[] fieldClasses)
protected java.lang.String[] getColumnNames()
public void setColumnFields(java.lang.Class objectClass, java.lang.String[] fieldNames)
public boolean isMarkable()
public void markRow(int row)
public void unmarkRow(int row)
public void clearMarks()
public void markAll()
public boolean isMarked(int row)
public boolean isMarkedEmpty()
public java.util.Collection getMarkedRows()
public java.util.Collection getMarkedObjects()
public void addMarkListener(AbstractIXTableModel.TableMarkListener tml)
public void removeMarkListener(AbstractIXTableModel.TableMarkListener tml)
public void fireTableMarkAdded(java.lang.Object rowObject)
public void fireTableMarkRemoved(java.lang.Object rowObject)
public void fireTableMarkCleared()
public void fireTableMarkedAll()
protected void deriveColumnFields()
protected void defaultSetColumnFields(java.lang.String[] fieldNames)
protected java.lang.Object defaultGetCellValueAt(java.lang.Object o, int columnIndex)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |