|
||||||||||
| 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.FormTableModel
public class FormTableModel
Table-model for FormTables.
| Field Summary |
|---|
| Fields inherited from class javax.swing.table.AbstractTableModel |
|---|
listenerList |
| Constructor Summary | |
|---|---|
FormTableModel(FormTableEntry template)
Creates an empty table model for a given template. |
|
FormTableModel(FormTableEntry template,
DbCursor<? extends DbObject> cursor)
Creates a table model for a database cursor. |
|
FormTableModel(FormTableEntry template,
List<?> list)
Creates a table model for a list of objects. |
|
FormTableModel(FormTableEntry template,
Object[] array)
Creates a table model for an array of objects. |
|
| Method Summary | |
|---|---|
void |
cursorChanged(DbCursor<? extends DbObject> cursor)
Sets a new cursor and fires tableDataChanged. |
Class |
getColumnClass(int columnIndex)
Returns Object.class regardless of columnIndex. |
int |
getColumnCount()
Returns the number of columns in the model. |
String |
getColumnName(int columnIndex)
Returns a default name for the column using spreadsheet conventions: A, B, C, ... |
String |
getDisplayedColumnName(int columnIndex)
Gets the displayed column name. |
FormTableEntry |
getEntryAt(int row)
Gets the form table entry at given row. |
int |
getRowCount()
Returns the number of rows in the model. |
FormTable |
getTable()
Gets the table. |
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. |
void |
listCellUpdated(int rowIndex,
int columnIndex)
Denotes that a table cell has changed and fires tableCellUpdated. |
void |
listChanged(List<?> list)
Sets a new list of objects and fires tableDataChanged. |
void |
listChanged(Object[] array)
Sets a new array of objects and fires tableDataChanged. |
void |
listDeleted(int firstRow,
int lastRow)
Denotes that a range of rows have been deleted and fires tableRowsDeleted. |
void |
listInserted(int firstRow,
int lastRow)
Denotes that a range of rows have been insert and fires tableRowsInserted. |
void |
listUpdated(int firstRow,
int lastRow)
Denotes that a range of rows have been changed and fires tableRowsUpdated. |
void |
setDataChanged(boolean dataChanged)
Sets a flag that model data has changed. |
boolean |
setEntryAt(FormTableEntry entry,
int row)
Sets the form table entry at given row. The default implementation just triggers a value changed event for the table. |
void |
setTemplate(FormTableEntry template)
Sets the template (useful if context changed) |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Sets the cell value. |
| Methods inherited from class org.tentackle.ui.AbstractFormTableModel |
|---|
getMap, getMappedIndex, getMappedIndex, getModelIndex, getModelIndex, isDataChanged, 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 |
| Constructor Detail |
|---|
public FormTableModel(FormTableEntry template,
DbCursor<? extends DbObject> cursor)
template - the table entry as a template to create other entriescursor - the database cursor
public FormTableModel(FormTableEntry template,
List<?> list)
template - the table entry as a template to create other entrieslist - the list of objects
public FormTableModel(FormTableEntry template,
Object[] array)
template - the table entry as a template to create other entriesarray - the array of objectspublic FormTableModel(FormTableEntry template)
template - the table entry as a template to create other entries| Method Detail |
|---|
public void setTemplate(FormTableEntry template)
template - the new templatepublic FormTableEntry getTemplate()
AbstractFormTableModel
getTemplate in class AbstractFormTableModelpublic 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.
TableModel.getColumnCount()public int getColumnCount()
javax.swing.table.TableModelJTable uses this method to determine how many columns it
should create and display by default.
TableModel.getRowCount()public String getColumnName(int columnIndex)
javax.swing.table.AbstractTableModelcolumn cannot be found,
returns an empty string.
getColumnName in interface TableModelgetColumnName in class AbstractTableModelcolumnIndex - the column being queried
columnpublic String getDisplayedColumnName(int columnIndex)
AbstractFormTableModel
getDisplayedColumnName in class AbstractFormTableModelcolumnIndex - column index
public Object getValueAt(int rowIndex,
int columnIndex)
javax.swing.table.TableModelcolumnIndex and
rowIndex.
rowIndex - 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)
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 void setDataChanged(boolean dataChanged)
Overridden to propagate triggerValueChanged()
setDataChanged in class AbstractFormTableModeldataChanged - true if model data has changedpublic FormTable getTable()
Overridden to get the table if models are chained
getTable in class AbstractFormTableModelpublic FormTableEntry getEntryAt(int row)
AbstractFormTableModel
getEntryAt in class AbstractFormTableModelrow - the row of the table entry
public boolean setEntryAt(FormTableEntry entry,
int row)
AbstractFormTableModel
setEntryAt in class AbstractFormTableModelentry - the formtable entryrow - the row of the table entry
public Class getColumnClass(int columnIndex)
javax.swing.table.AbstractTableModelObject.class regardless of columnIndex.
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelcolumnIndex - 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 void cursorChanged(DbCursor<? extends DbObject> cursor)
cursor - the new cursorpublic void listChanged(List<?> list)
list - the new list of objectspublic void listChanged(Object[] array)
array - the new array of objects
public void listUpdated(int firstRow,
int lastRow)
firstRow - the first rowlastRow - the last changed row (>= firstRow)
public void listCellUpdated(int rowIndex,
int columnIndex)
rowIndex - the row numbercolumnIndex - the column index
public void listInserted(int firstRow,
int lastRow)
firstRow - the first rowlastRow - the last changed row (>= firstRow)
public void listDeleted(int firstRow,
int lastRow)
firstRow - the first rowlastRow - the last changed row (>= firstRow)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||