Class FWTableChoiceSubComponent.FWTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
net.simplace.pipe.formcomponents.choice.FWTableChoiceSubComponent.FWTableModel
- All Implemented Interfaces:
Serializable
,TableModel
- Enclosing class:
- FWTableChoiceSubComponent
TableModel
for FWTableChoiceSubComponent
.
Even the constructors technically accept FWFormOption
the table model
requires instances of FWFormTableOption
. Exception will be generated
otherwise!- Author:
- Martin Schmitz
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected FWFormTableOption
protected Vector<FWFormTableOption>
protected Vector<FWFormTableOption>
protected int
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
ConstructorDescriptionFWTableModel
(Vector<FWFormOption> aOptions, int aSelectionValueColIdx) Creates table model fromFWFormOptions
. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>
getColumnClass
(int col) Returns the class for a column.int
Returns the number of table columns.getColumnName
(int col) Returns the name for a column.Returns theFWFormTableOption
which represents the table header.int
Returns the number of table rows.getRowOption
(int row) Returns theFWFormTableOption
which represents the specified row, e.g. to retrieve the ID of the option to set selection.getSelectionValueAt
(int row) Returns the cell value which represents the selection / choice value for the specified table row.getValueAt
(int row, int col) Returns a table cell value.protected void
init
(Vector<FWFormOption> aOptions) Called by constructor andupdateTable(Vector)
to initialize table model fromFWFormOptions
.void
updateTable
(Vector<FWFormOption> aFormOptionVector) Updates the table data from form options.Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
-
Field Details
-
iOptions
-
iRowOptions
-
iHeadOption
-
iSelectionValueColIdx
protected int iSelectionValueColIdx
-
-
Constructor Details
-
FWTableModel
Creates table model fromFWFormOptions
. Note: Even the constructor technically acceptsFWFormOption
, the table model requires instances ofFWFormTableOption
. Exception will be generated otherwise!- Parameters:
aOptions
- set of optionsaSelectionValueColIdx
- specifies the table column, the selection value of the choice is taken from
-
-
Method Details
-
init
Called by constructor andupdateTable(Vector)
to initialize table model fromFWFormOptions
. Note: Even the method technically acceptsFWFormOption
, the table model requires instances ofFWFormTableOption
. Exception will be generated otherwise!- Parameters:
aOptions
- set of options
-
getRowCount
public int getRowCount()Returns the number of table rows. -
getColumnCount
public int getColumnCount()Returns the number of table columns. -
getColumnName
Returns the name for a column. Wildcards for map parameters are replaces at this point usingFWAbstractFormSubComponent.iObservable
.- Specified by:
getColumnName
in interfaceTableModel
- Overrides:
getColumnName
in classAbstractTableModel
-
getColumnClass
Returns the class for a column.- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
getValueAt
Returns a table cell value. Wildcards for map parameters are replaces at this point usingFWAbstractFormSubComponent.iObservable
. -
getRowOption
Returns theFWFormTableOption
which represents the specified row, e.g. to retrieve the ID of the option to set selection.- Parameters:
row
-- Returns:
-
getHeaderOption
Returns theFWFormTableOption
which represents the table header.- Returns:
-
getSelectionValueAt
Returns the cell value which represents the selection / choice value for the specified table row.- Parameters:
row
-- Returns:
-
updateTable
Updates the table data from form options.- Parameters:
aFormOptionVector
-
-