Package weka.gui

# Class InteractiveTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
weka.gui.InteractiveTableModel

All Implemented Interfaces:
  `Serializable`, `TableModel`

Direct Known Subclasses:
  `InteractiveTableModel`

public class InteractiveTableModel extends AbstractTableModel
Table model that automatically adds a new row to the table on pressing enter in the last cell of a row.

Version:
  $Revision: 47640 $
Author:
  Mark Hall (mhall{[at]}pentaho{[dot]}com)
See Also:
  - Serialized Form

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `m_hidden_index`
  Index of the hidden column

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `InteractiveTableModel(String[] columnNames)`
  Constructor

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addEmptyRow()`
  Adds an empty row to the model
  `Class<?>`
  `getColumnClass(int column)`
  `int`
  `getColumnCount()`
  `String`
  `getColumnName(int column)`
  `int`
  `getRowCount()`
  `Object`
  `getValueAt(int row, int column)`
  `boolean`
  `hasEmptyRow()`
  Returns true if the model has an empty row
  `boolean`
  `isCellEditable(int row, int column)`
  `void`
  `setValueAt(Object value, int row, int column)`

  ### Methods inherited from class javax.swing.table.AbstractTableModel

  `addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### m_hidden_index

    public int m_hidden_index
    Index of the hidden column

- ## Constructor Details

  - ### InteractiveTableModel

    public InteractiveTableModel(String[] columnNames)
    Constructor
    Parameters:
      `columnNames` - the names of the columns

- ## Method Details

  - ### getColumnName

    public String getColumnName(int column)
    Specified by:
      `getColumnName` in interface `TableModel`
    Overrides:
      `getColumnName` in class `AbstractTableModel`

  - ### isCellEditable

    public boolean isCellEditable(int row, int column)
    Specified by:
      `isCellEditable` in interface `TableModel`
    Overrides:
      `isCellEditable` in class `AbstractTableModel`

  - ### getColumnClass

    public Class<?> getColumnClass(int column)
    Specified by:
      `getColumnClass` in interface `TableModel`
    Overrides:
      `getColumnClass` in class `AbstractTableModel`

  - ### getValueAt

    public Object getValueAt(int row, int column)

  - ### setValueAt

    public void setValueAt(Object value, int row, int column)
    Specified by:
      `setValueAt` in interface `TableModel`
    Overrides:
      `setValueAt` in class `AbstractTableModel`

  - ### getRowCount

    public int getRowCount()

  - ### getColumnCount

    public int getColumnCount()

  - ### hasEmptyRow

    public boolean hasEmptyRow()
    Returns true if the model has an empty row
    Returns:
      true if the model has an empty row

  - ### addEmptyRow

    public void addEmptyRow()
    Adds an empty row to the model