T - the type managed by the modelpublic class FormTableModel<T> extends AbstractFormTableModel<T> implements BindableTableModel<T>
FormTables.BindableTableModel.BindTypelistenerList| Constructor and Description |
|---|
FormTableModel(FormTableEntry<T> template)
Creates an empty table model for a given template.
|
FormTableModel(FormTableEntry<T> template,
List<T> list)
Creates a table model for a list of objects.
|
FormTableModel(FormTableEntry<T> template,
T[] array)
Creates a table model for an array of objects.
|
| Modifier and Type | Method and Description |
|---|---|
void |
bind()
Binds the model.
|
protected FormTableBinder |
createBinder()
Creates a binder for this form.
The default implementation invokes FormBindingFactory.createFormTableBinder(this). |
FormTableBinder |
getBinder()
Gets the binder of this container.
|
FormTableBinding |
getBinding(int columnIndex)
Gets the binding for a given column.
|
String |
getBindingPath(int mColumn)
Gets the binding path for given model column.
The returned path is relative to the object described by this table entry. |
Class<?> |
getBindingRootClass()
Gets the root class where to start scan for
Bindables. |
BindableTableModel.BindType |
getBindType()
Determines whether the model using this entry is bindable and if so, which kind of binding to use.
|
Class<?> |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
String |
getColumnName(int columnIndex) |
String |
getDisplayedColumnName(int columnIndex)
Gets the displayed column name.
|
FormTableEntry<T> |
getEntryAt(int row)
Gets the form table entry at given row.
|
int |
getRowCount() |
FormTable<T> |
getTable()
Gets the table.
|
FormTableEntry<T> |
getTemplate()
Gets the table entry template from the model.
|
Object |
getValueAt(int rowIndex,
int columnIndex) |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
void |
listCellUpdated(int rowIndex,
int columnIndex)
Denotes that a table cell has changed and fires tableCellUpdated.
|
void |
listChanged(List<T> list)
Sets a new list of objects and fires tableDataChanged.
|
void |
listChanged(T[] 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<T> 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<T> template)
Sets the template.
Useful if context has changed. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Sets the cell value.
|
String |
toString()
Prints the classname of the table entry.
|
getMap, getMappedIndex, getMappedIndex, getModelIndex, getModelIndex, isDataChanged, setMap, setTableaddTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitsetTableaddTableModelListener, removeTableModelListenerpublic FormTableModel(FormTableEntry<T> template, List<T> list)
template - the table entry as a template to create other entrieslist - the list of objectspublic FormTableModel(FormTableEntry<T> template, T[] array)
template - the table entry as a template to create other entriesarray - the array of objectspublic FormTableModel(FormTableEntry<T> template)
template - the table entry as a template to create other entriespublic void setTemplate(FormTableEntry<T> template)
template - the new templateprotected FormTableBinder createBinder()
FormBindingFactory.createFormTableBinder(this).public FormTableBinder getBinder()
BindableTableModelgetBinder in interface BindableTableModel<T>public BindableTableModel.BindType getBindType()
BindableTableModelgetBindType in interface BindableTableModel<T>public Class<?> getBindingRootClass()
BindableTableModelBindables.
For FormTableModels this is the class of the FormTableEntry.
Other models may refer to other classes.
getBindingRootClass in interface BindableTableModel<T>public void bind()
BindableTableModel.BindType.
If the bindtype is BindableTableModel.BindType.NONE, nothing will be bound.getBindType(),
getBinder()public String toString()
public FormTableEntry<T> getTemplate()
AbstractFormTableModelgetTemplate in class AbstractFormTableModel<T>public int getRowCount()
getRowCount in interface TableModelpublic int getColumnCount()
getColumnCount in interface TableModelpublic String getColumnName(int columnIndex)
getColumnName in interface TableModelgetColumnName in class AbstractTableModelpublic String getDisplayedColumnName(int columnIndex)
AbstractFormTableModelgetDisplayedColumnName in class AbstractFormTableModel<T>columnIndex - column indexpublic FormTableBinding getBinding(int columnIndex)
getBinding in interface BindableTableModel<T>columnIndex - the model columnpublic Object getValueAt(int rowIndex, int columnIndex)
getValueAt in interface TableModelpublic void setValueAt(Object aValue, int rowIndex, int columnIndex)
setValueAt in interface TableModelsetValueAt in class AbstractTableModelpublic String getBindingPath(int mColumn)
getBindingPath in interface BindableTableModel<T>mColumn - the datamodel-columnpublic void setDataChanged(boolean dataChanged)
Overridden to propagate triggerValueChanged()
setDataChanged in class AbstractFormTableModel<T>dataChanged - true if model data has changedpublic FormTable<T> getTable()
Overridden to get the table if models are chained
getTable in interface BindableTableModel<T>getTable in class AbstractFormTableModel<T>public FormTableEntry<T> getEntryAt(int row)
AbstractFormTableModelgetEntryAt in class AbstractFormTableModel<T>row - the row of the table entrypublic boolean setEntryAt(FormTableEntry<T> entry, int row)
AbstractFormTableModelsetEntryAt in class AbstractFormTableModel<T>entry - the formtable entryrow - the row of the table entrypublic Class<?> getColumnClass(int columnIndex)
getColumnClass in interface TableModelgetColumnClass in class AbstractTableModelpublic boolean isCellEditable(int rowIndex,
int columnIndex)
isCellEditable in interface TableModelisCellEditable in class AbstractTableModelpublic void listChanged(List<T> list)
list - the new list of objectspublic void listChanged(T[] array)
array - the new array of objectspublic 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 indexpublic 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)Tentackle - a domain driven enterprise framework