T - the class of the object decorated by this FormTableEntrypublic abstract class FormTableEntry<T> extends Object implements FormTableRowObject
| Constructor and Description |
|---|
FormTableEntry() |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(FormTableEntry<? extends T> entry,
int[] compareBy)
Compares this entry with another one (for sorting).
|
void |
fireCellsUpdated(int... mColumns)
Fires an update of the given cells in current row.
|
void |
fireRowUpdated()
Fires an update of all cells in the current row.
|
Character |
getAdjust(int mColumn)
Defines the adjust attribute
for each column.
|
FormTableBinding |
getBinding(int mColumn)
Gets the binding for a given model 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. |
BindableTableModel.BindType |
getBindType()
Determines whether the model using this entry is bindable and if so, which kind of binding to use.
|
TableCellEditor |
getCellEditor(int mColumn)
Gets the cell editor for a given column.
|
Rectangle |
getCellRect(int vRow,
int vColumn,
boolean includeSpacing)
Gets the cellrect for a column.
The method is only invoked if isCellRectFixed() returns false. |
TableCellRenderer |
getCellRenderer(int mColumn)
Gets the cell renderer for a given column.
Depending on isCellRendererFixed() this method is invoked only once per column or for each cell. |
Class<?> |
getColumnClass(int mColumn)
Determines the class for a given column.
If not overridden (or returning null) the class will be determined by inspecting the data. |
abstract int |
getColumnCount()
Determines the number of data-model columns.
|
abstract String |
getColumnName(int mColumn)
Describes the column name.
This may be a symbolic name if getDisplayedColumnName() is overridden. |
Character |
getConvert(int mColumn)
Defines the character conversion attribute
for each column.
|
String |
getDisplayedColumnName(int mColumn)
Gets the displayed column name.
By default the column-name and the displayed column name are the same. |
String |
getFormat(int mColumn)
Defines the format (for numeric or date/time-types)
for each column.
|
Integer |
getHorizontalAlignment(int mColumn)
Defines the horizontal alignment
for each column.
|
Integer |
getMaxColumns(int mColumn)
Gets the maximum columns for text cell editors.
|
FormTableModel<T> |
getModel()
Gets the model.
|
abstract T |
getObject()
Gets the object wrapped by this entry.
|
int |
getReferencedColumn(int vRow,
int vColumn)
Gets the referenced column if cells are merged.
If cells are merged they must reference to valid cell. |
int |
getReferencedRow(int vRow,
int vColumn)
Gets the referenced row if cells are merged.
If cells are merged they must reference to valid cell. |
int |
getRow()
Gets the row of this entry with respect to the model.
|
Integer |
getScale(int mColumn)
Gets the scale for fractional numeric cell editors.
|
boolean |
getShowHorizontalLine(int vRow)
Determines whether the horizontal grid line following the
given row should be drawn or not.
|
boolean |
getShowVerticalLine(int vRow,
int vColumn)
Determines whether the vertical grid line following the
given cell should be drawn or not.
|
FormTable |
getTable()
Gets the table.
|
Object |
getValueAt(int mColumn)
Gets the column-object for this entry in a given column.
The default implementation tries to use the binding, if any. |
Integer |
getVerticalAlignment(int mColumn)
Defines the vertical alignment
for each column.
|
Boolean |
isAutoSelect(int mColumn)
Gets the autoselect flag.
|
boolean |
isBindingChangeable(int mColumn)
Determines whether the binding allows given cell to be changeable.
|
Boolean |
isBlankZero(int mColumn)
Defines the "blankzero" attribute
for each column.
|
boolean |
isCellEditable(int mColumn)
Determines whether the cell is editable or not.
The default is not editable. |
boolean |
isCellEditorFixed()
Determines whether the cell editors are fixed.
FormTable invokes getCellEditor in FormTableEntry only once to improve performance. |
boolean |
isCellRectFixed()
Determines whether the cell rectangles are fixed.
Usually the cell dimension is fixed and does not depend on the data. |
boolean |
isCellRendererFixed()
Determines whether the cell renderers are fixed.
FormTable invokes getCellRenderer in FormTableEntry only once to improve performance. |
boolean |
isCellVisible(int vRow,
int vColumn)
Determines whether the cell is visible or not.
The method is only invoked if isCellRectFixed() returns false. |
boolean |
isColumnNotSummable(int mColumn)
Determines whether the given column is summable.
The SumFormTableEntry will sumup all numeric columns by default. |
boolean |
isVisiblyEqual(FormTableEntry<? extends T> entry)
Compares what the user sees on the GUI between two HistoryTableEntries.
|
abstract FormTableEntry<T> |
newInstance(T object)
Creates a new instance of an entry for a given data-object.
|
void |
setModel(FormTableModel<T> model)
Sets the model this entry lives in.
|
void |
setRow(int row)
Sets the row of this entry with respect to the model.
|
void |
setValueAt(int mColumn,
Object value)
Sets the data object for a column.
The default implementation tries to use the binding, if any. |
boolean |
updateArray(int mRow)
Performs an update of the current entry to the underlying
array, if the data-model is based on an object array.
|
boolean |
updateCursor(int mRow)
Performs an update of the current entry to the underlying
database cursor, if the data-model is based on a cursor.
|
boolean |
updateList(int mRow)
Performs an update of the current entry to the underlying
list, if the data-model is based on a List.
|
public abstract FormTableEntry<T> newInstance(T object)
object - the data-objectpublic abstract int getColumnCount()
public abstract String getColumnName(int mColumn)
mColumn - the datamodel-columnpublic String getDisplayedColumnName(int mColumn)
mColumn - the datamodel columnpublic Class<?> getColumnClass(int mColumn)
mColumn - the datamodel-columnpublic String getFormat(int mColumn)
mColumn - the datamodel-columnpublic Integer getHorizontalAlignment(int mColumn)
mColumn - the datamodel-columnpublic Integer getVerticalAlignment(int mColumn)
mColumn - the datamodel-columnpublic Boolean isBlankZero(int mColumn)
mColumn - the datamodel-columnpublic FormTableBinding getBinding(int mColumn)
mColumn - the model columnpublic Boolean isAutoSelect(int mColumn)
mColumn - the datamodel-columnpublic Integer getMaxColumns(int mColumn)
mColumn - the model column indexpublic Integer getScale(int mColumn)
mColumn - the model column indexpublic Character getConvert(int mColumn)
mColumn - the datamodel-columnpublic Character getAdjust(int mColumn)
mColumn - the datamodel-columnpublic boolean isColumnNotSummable(int mColumn)
mColumn - the datamodel columnpublic boolean isCellRendererFixed()
public boolean isCellEditorFixed()
public boolean isCellRectFixed()
public void setModel(FormTableModel<T> model)
model - the data-modelpublic FormTableModel<T> getModel()
getModel in interface FormTableRowObjectpublic FormTable getTable()
FormTableRowObjectgetTable in interface FormTableRowObjectpublic void setRow(int row)
row - the data-model rowpublic int getRow()
getRow in interface FormTableRowObjectpublic abstract T getObject()
public Object getValueAt(int mColumn)
getValueAt in interface FormTableRowObjectmColumn - the datamodel-columnpublic void setValueAt(int mColumn,
Object value)
setValueAt in interface FormTableRowObjectmColumn - the datamodel-columnvalue - the cell valuepublic BindableTableModel.BindType getBindType()
BindableTableModel.BindType.BIND.public String getBindingPath(int mColumn)
mColumn - the datamodel-columnpublic boolean updateCursor(int mRow)
mRow - the datamodel-rowpublic boolean updateList(int mRow)
mRow - the datamodel-rowpublic boolean updateArray(int mRow)
mRow - the datamodel-rowpublic int compareTo(FormTableEntry<? extends T> entry, int[] compareBy)
entry - to be compared against this entrycompareBy - is an array of mColumns where 0 is the first and
negative minus 1 means descending. I.e.: [-1, 2] means:
first column descending, third ascendingpublic boolean isVisiblyEqual(FormTableEntry<? extends T> entry)
entry - to be compared against this entrypublic TableCellRenderer getCellRenderer(int mColumn)
mColumn - the datamodel-columnpublic boolean isBindingChangeable(int mColumn)
Note: can be used to implement isCellEditable(int) for
interactive table entries.
mColumn - the model columnpublic boolean isCellEditable(int mColumn)
mColumn - the datamodel-columnisBindingChangeable(int)public TableCellEditor getCellEditor(int mColumn)
mColumn - the datamodel-columnpublic Rectangle getCellRect(int vRow, int vColumn, boolean includeSpacing)
Note: Usually tables with dynamic cell sizes (i.e. multispan columns) don't allow the user to change column ordering and/or sort rows. For optimization reasons the given row and column are according to the view which is usually is identical to the model. If this is not the case (which is hard to handle btw.) getCellRect must convert the row and column to the datamodel.
vRow - the row in table viewvColumn - the column in table viewincludeSpacing - is true to include marginspublic boolean isCellVisible(int vRow,
int vColumn)
vRow - the row in table viewvColumn - the column in table viewpublic int getReferencedRow(int vRow,
int vColumn)
vRow - the row in table viewvColumn - the column in table viewpublic int getReferencedColumn(int vRow,
int vColumn)
vRow - the row in table viewvColumn - the column in table viewpublic boolean getShowHorizontalLine(int vRow)
vRow - the row in table viewpublic boolean getShowVerticalLine(int vRow,
int vColumn)
vRow - the row in table viewvColumn - the column in table viewpublic void fireRowUpdated()
public void fireCellsUpdated(int... mColumns)
mColumns - columns with respect to the modelTentackle - distributed, domain- and model-driven