|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.table.AbstractTableModel
org.tentackle.ui.AbstractFormTableModel
org.tentackle.ui.FormTableMap
public class FormTableMap
Generic mapping of the rows within a FormTable.
Implementing a sorter is easily done by subclassing FormTableMap.
| Field Summary | |
|---|---|
protected AbstractFormTableModel |
model
chained table model |
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
FormTableMap(AbstractFormTableModel model)
Creates a form table map on top of a given table model. |
|
| Method Summary | |
|---|---|
Class |
getColumnClass(int col)
Returns Object.class regardless of columnIndex. |
int |
getColumnCount()
Returns the number of columns in the model. |
String |
getColumnName(int column)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... |
String |
getDisplayedColumnName(int column)
Gets the displayed column name. |
FormTableEntry |
getEntryAt(int rowIndex)
Gets the form table entry at given row. |
int |
getMappedIndex(int mappedRow)
Gets the mapped row index according to a given model row. Inversion of getModelIndex(). |
int[] |
getMappedIndex(int[] mappedRows)
Gets the mapped row indexes according to given model rows. Inversion of getModelIndex(). |
AbstractFormTableModel |
getModel()
Gets the table model this table mapper maps. |
int |
getModelIndex(int row)
Gets the row in the original model according to the mapping. The default implementation returns the same row. |
int[] |
getModelIndex(int[] rows)
Gets the rows in the original model according to the mapping. The default implementation returns the same rows. |
int |
getRowCount()
Returns the number of rows in the model. |
FormTableEntry |
getTemplate()
Gets the table entry template from the model. |
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at columnIndex and
rowIndex. |
boolean |
isCellEditable(int rowIndex,
int columnIndex)
Returns false. |
boolean |
isDataChanged()
Returns whether data has changed. |
void |
setDataChanged(boolean dataChanged)
Sets a flag that model data has changed. |
void |
setModel(AbstractFormTableModel model)
Sets the table model. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
This empty implementation is provided so users don't have to implement this method if their data model is not editable. |
void |
tableChanged(TableModelEvent e)
This fine grain notification tells listeners the exact range of cells, rows, or columns that changed. |
| Methods inherited from class org.tentackle.ui.AbstractFormTableModel |
|---|
getMap, getTable, setEntryAt, setMap, setTable |
| 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 AbstractFormTableModel model
| Constructor Detail |
|---|
public FormTableMap(AbstractFormTableModel model)
model - the chained table model| Method Detail |
|---|
public AbstractFormTableModel getModel()
public void setModel(AbstractFormTableModel model)
model - the table modelpublic FormTableEntry getTemplate()
AbstractFormTableModel
getTemplate in class AbstractFormTableModel
public Object getValueAt(int rowIndex,
int columnIndex)
columnIndex and
rowIndex.
This method must be overridden for another mapping than 1:1.
getValueAt in interface TableModelrowIndex - the row whose value is to be queriedcolumnIndex - the column whose value is to be queried
public void setValueAt(Object aValue,
int rowIndex,
int columnIndex)
This method must be overridden for another mapping than 1:1.
setValueAt in interface TableModelsetValueAt in class AbstractTableModelaValue - value to assign to cellrowIndex - row of cellcolumnIndex - column of cellTableModel.getValueAt(int, int),
TableModel.isCellEditable(int, int)public FormTableEntry getEntryAt(int rowIndex)
AbstractFormTableModel
getEntryAt in class AbstractFormTableModelrowIndex - the row of the table entry
public int getRowCount()
javax.swing.table.TableModelJTable uses this method to determine how many rows it
should display. This method should be quick, as it
is called frequently during rendering.
getRowCount in interface TableModelTableModel.getColumnCount()public int getColumnCount()
javax.swing.table.TableModelJTable uses this method to determine how many columns it
should create and display by default.
getColumnCount in interface TableModelTableModel.getRowCount()public String getColumnName(int column)
javax.swing.table.AbstractTableModelcolumn cannot be found,
returns an empty string.
getColumnName in interface TableModelgetColumnName in class AbstractTableModelcolumn - the column being queried
columnpublic String getDisplayedColumnName(int column)
AbstractFormTableModel
getDisplayedColumnName in class AbstractFormTableModelcolumn - column index
public Class getColumnClass(int col)
javax.swing.table.AbstractTableModelObject.class regardless of columnIndex.
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelcol - the column being queried
public boolean isCellEditable(int rowIndex,
int columnIndex)
javax.swing.table.AbstractTableModel
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelrowIndex - the row being queriedcolumnIndex - the column being queried
TableModel.setValueAt(java.lang.Object, int, int)public int getMappedIndex(int mappedRow)
AbstractFormTableModel
getMappedIndex in class AbstractFormTableModelmappedRow - the original row
public int[] getMappedIndex(int[] mappedRows)
AbstractFormTableModel
getMappedIndex in class AbstractFormTableModelmappedRows - the original rows
public int getModelIndex(int row)
AbstractFormTableModel
getModelIndex in class AbstractFormTableModelrow - the row of this model
public int[] getModelIndex(int[] rows)
AbstractFormTableModel
getModelIndex in class AbstractFormTableModelrows - the array of rows of this model
public void tableChanged(TableModelEvent e)
Event handler for TableModelListener: table data has changed.
This method must be overridden for another mapping than 1:1.
The default implementation just invokes fireTableChanged.
tableChanged in interface TableModelListenere - the table model eventpublic boolean isDataChanged()
AbstractFormTableModel
isDataChanged in class AbstractFormTableModelpublic void setDataChanged(boolean dataChanged)
AbstractFormTableModel
setDataChanged in class AbstractFormTableModeldataChanged - true if model data has changed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||