|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.table.AbstractTableModel
org.archiviststoolkit.mydomain.DomainTableModel
public class DomainTableModel
The model used to display lists of domain objects inside a JTable.
Field Summary | |
---|---|
protected java.lang.Class |
clazz
The class of this domain table. |
protected java.util.ArrayList |
columnModel
A list of column models. |
protected java.util.ArrayList<DomainObject> |
domainCollection
The list of domainobjects to display. |
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
DomainTableModel()
|
Method Summary | |
---|---|
void |
addDomainObject(DomainObject object)
|
void |
addDomainObject(int index,
DomainObject object)
|
void |
domainChanged(DomainAccessEvent event)
Notify this model that the domain has changed state. |
DomainObject |
get(int index)
Get a domain object for a specific row in the list. |
java.lang.Class |
getColumnClass(int index)
Get the class associated with a column. |
int |
getColumnCount()
Get the number of columns. |
java.lang.String |
getColumnName(int index)
Get the name of a specific column. |
java.lang.Object |
getColumnValue(java.lang.Object object,
int column)
Get the value for a specific column. |
java.lang.Class |
getDomainClass()
Get the domain model class. |
java.util.ArrayList<DomainObject> |
getDomainCollection()
|
int |
getIndex(DomainObject object)
Get the row index of a specific domain object. |
int |
getRowCount()
Get the number of rows in this domain. |
DomainTableModelColumn |
getTableModelColumn(int index)
Get the table model for a specific column. |
java.lang.Object |
getValueAt(int row,
int column)
Get the value at a specific row or column. |
boolean |
isCellEditable(int row,
int col)
Get the domain model class. |
void |
removeDomainObject(int index)
|
java.lang.Object |
setColumnValue(java.lang.Object object,
int column,
java.lang.Object value)
Get the value for a specific column. |
void |
setDomainObject(int index,
DomainObject object)
|
void |
setValueAt(java.lang.Object value,
int row,
int col)
|
void |
updateCollection(java.util.Collection newCollection)
|
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.lang.Class clazz
protected java.util.ArrayList<DomainObject> domainCollection
protected java.util.ArrayList columnModel
Constructor Detail |
---|
public DomainTableModel()
Method Detail |
---|
public DomainTableModelColumn getTableModelColumn(int index)
index
- the index of the column
public java.lang.String getColumnName(int index)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
index
- the index of the column
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.Class getColumnClass(int index)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
index
- the index of the column
public java.lang.Object getColumnValue(java.lang.Object object, int column)
object
- the domain object used for this rowcolumn
- the column to get
public java.lang.Object setColumnValue(java.lang.Object object, int column, java.lang.Object value)
object
- the domain object used for this rowcolumn
- the column to get
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 java.lang.Class getDomainClass()
public void domainChanged(DomainAccessEvent event)
domainChanged
in interface DomainAccessListener
event
- the type of state changepublic int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int row, int column)
getValueAt
in interface javax.swing.table.TableModel
row
- the rowcolumn
- the column
public DomainObject get(int index)
index
- the index within the row
public int getIndex(DomainObject object)
object
- the object in question
public void setDomainObject(int index, DomainObject object)
public void addDomainObject(DomainObject object)
public void addDomainObject(int index, DomainObject object)
public void removeDomainObject(int index)
public void updateCollection(java.util.Collection newCollection)
public java.util.ArrayList<DomainObject> getDomainCollection()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |