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

protected class FWTableChoiceSubComponent.FWTableModel extends AbstractTableModel
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 Details

  • Constructor Details

    • FWTableModel

      public FWTableModel(Vector<FWFormOption> aOptions, int aSelectionValueColIdx)
      Creates table model from FWFormOptions. Note: Even the constructor technically accepts FWFormOption, the table model requires instances of FWFormTableOption. Exception will be generated otherwise!
      Parameters:
      aOptions - set of options
      aSelectionValueColIdx - specifies the table column, the selection value of the choice is taken from
  • Method Details

    • init

      protected void init(Vector<FWFormOption> aOptions)
      Called by constructor and updateTable(Vector) to initialize table model from FWFormOptions. Note: Even the method technically accepts FWFormOption, the table model requires instances of FWFormTableOption. 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

      public String getColumnName(int col)
      Returns the name for a column. Wildcards for map parameters are replaces at this point using FWAbstractFormSubComponent.iObservable.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • getColumnClass

      public Class<?> getColumnClass(int col)
      Returns the class for a column.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • getValueAt

      public Object getValueAt(int row, int col)
      Returns a table cell value. Wildcards for map parameters are replaces at this point using FWAbstractFormSubComponent.iObservable.
    • getRowOption

      public FWFormTableOption getRowOption(int row)
      Returns the FWFormTableOption which represents the specified row, e.g. to retrieve the ID of the option to set selection.
      Parameters:
      row -
      Returns:
    • getHeaderOption

      public FWFormTableOption getHeaderOption()
      Returns the FWFormTableOption which represents the table header.
      Returns:
    • getSelectionValueAt

      public Object getSelectionValueAt(int row)
      Returns the cell value which represents the selection / choice value for the specified table row.
      Parameters:
      row -
      Returns:
    • updateTable

      public void updateTable(Vector<FWFormOption> aFormOptionVector)
      Updates the table data from form options.
      Parameters:
      aFormOptionVector -