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
FieldsModifier and TypeFieldDescriptionprotected FWFormTableOptionprotected Vector<FWFormTableOption>protected Vector<FWFormTableOption>protected intFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
ConstructorsConstructorDescriptionFWTableModel(Vector<FWFormOption> aOptions, int aSelectionValueColIdx) Creates table model fromFWFormOptions. -
Method Summary
Modifier and TypeMethodDescriptionClass<?>getColumnClass(int col) Returns the class for a column.intReturns the number of table columns.getColumnName(int col) Returns the name for a column.Returns theFWFormTableOptionwhich represents the table header.intReturns the number of table rows.getRowOption(int row) Returns theFWFormTableOptionwhich 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 voidinit(Vector<FWFormOption> aOptions) Called by constructor andupdateTable(Vector)to initialize table model fromFWFormOptions.voidupdateTable(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:
getColumnNamein interfaceTableModel- Overrides:
getColumnNamein classAbstractTableModel
-
getColumnClass
Returns the class for a column.- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
getValueAt
Returns a table cell value. Wildcards for map parameters are replaces at this point usingFWAbstractFormSubComponent.iObservable. -
getRowOption
Returns theFWFormTableOptionwhich represents the specified row, e.g. to retrieve the ID of the option to set selection.- Parameters:
row-- Returns:
-
getHeaderOption
Returns theFWFormTableOptionwhich 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-
-