|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Strategy that describes how individual records of an AbstractTableModel
are to be
split up into columns of a table and how the individual cells are to be displayed and edited.
You should think of a TableEntryDescriptor as a device that is given a record and splits this record into individual values, that correspond to cells.
When implementing this interface, you might want to subclass AbstractTableEntryDescriptor
, that
will already give you a head start with some of the more common tasks.
JAbstractTable
Method Summary | |
boolean |
canSortByColumn(int nIdx)
Return true if the records can be sorted by the specified column. |
TableCellEditor |
getCellEditor(int nIdx)
Return the cell editor to be used for cells in the given column. |
TableCellRenderer |
getCellRenderer(int nIdx)
Return the cell renderer to be used for cells in the given column. |
Class |
getColumnClass(int nIdx)
Return the class of objects that make up the values of cells of the given column. |
int |
getColumnCount()
Return the number of columns each record will consist of. |
String |
getColumnName(int nIdx)
Return the text to be printed in the header of the given column. |
Comparator |
getColumnOrder(int nIdx)
Return a comparator to be used when ordering records by the specified column. |
Object |
getValueAt(Object oRecord,
int nIdx)
Get the value to be printed in the given column for the given record. |
boolean |
isElementEditable(Object oRecord,
int nIdx)
Return whether a given column is editable for a given record. |
void |
setValueAt(Object oRecord,
int nIdx,
Object oValue)
Set the value of the given column for the given record. |
Method Detail |
public int getColumnCount()
public String getColumnName(int nIdx)
nIdx
- the index of the column for which to return the header. Indices run from 0 to
getColumnCount() - 1
.
public Class getColumnClass(int nIdx)
getCellEditor(int)
and
getCellRenderer(int)
.
nIdx
- the index of the column for which to return the value class. Indices run from 0 to
getColumnCount() - 1
.
public TableCellRenderer getCellRenderer(int nIdx)
nIdx
- the index of the column for which to return the renderer. Indices run from 0 to
getColumnCount() - 1
.
null
to
indicate that the default cell renderer for the column class
should be used.public TableCellEditor getCellEditor(int nIdx)
isElementEditable(java.lang.Object, int)
returns true for the column and a given record.
nIdx
- the index of the column for which to return the editor. Indices run from 0 to
getColumnCount() - 1
.
null
to
indicate that the default cell editor for the column class
should be used.public Object getValueAt(Object oRecord, int nIdx)
oRecord
- the record for which to determine the value. The actual class depends on the
AbstractTableModel
you are working with. It will be declared in the documentation for
the AbstractTableModel.getRecord(int)
method of that class.nIdx
- the index of the column for which to return the cell value. Indices run from 0 to
getColumnCount() - 1
.
getColumnClass(int)
or that class itself.public boolean isElementEditable(Object oRecord, int nIdx)
oRecord
- the record for which to determine editability. The actual class depends on the
AbstractTableModel
you are working with. It will be declared in the documentation for
the AbstractTableModel.getRecord(int)
method of that class.nIdx
- the index of the column for which to determine editability. Indices run from 0 to
getColumnCount() - 1
.
public void setValueAt(Object oRecord, int nIdx, Object oValue)
This method will only be invoked if isElementEditable(java.lang.Object, int)
returned true for the given cell and if
the user actually edited the given cell.
Note that changes will only become visible if they result in an event being fired to the JTable that uses the model.
oRecord
- the record for which to determine the value. The actual class depends on the
AbstractTableModel
you are working with. It will be declared in the documentation for
the AbstractTableModel.getRecord(int)
method of that class.nIdx
- the index of the column for which to return the cell value. Indices run from 0 to
getColumnCount() - 1
.oValue
- the value to become the new value of the cell. The class of this object depends on the
editor used for editing the cell. Normally, this will be determined by getCellEditor(int)
.public boolean canSortByColumn(int nIdx)
getColumnOrder(int)
must return a valid comparator for the specified column.
nIdx
- the index of the column concerned.
public Comparator getColumnOrder(int nIdx)
nIdx
- the index of the column concerned.
|
SalesPoint Framework v3.1 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |