Holger's Java API

## com.antelmann.sql
Class RowItemTableModel

    java.lang.Object
      javax.swing.table.AbstractTableModel
          com.antelmann.sql.RowItemTableModel

All Implemented Interfaces:
  EditableComponent, Serializable, TableModel

    public class RowItemTableModel

extends AbstractTableModel
implements EditableComponent

the implementation requires that the columns are properly set on all RowItem objects used within the model.

Author:
  Holger Antelmann
See Also:
  Serialized Form

Field Summary

Fields inherited from class javax.swing.table.AbstractTableModel
`listenerList`

Constructor Summary
`RowItemTableModel(List<RowItem> list)`

Method Summary
`Class<?>` `getColumnClass(int column)`
`int` `getColumnCount()`
`String` `getColumnName(int column)`
`Collection<RowItem>` `getDirtyRows()` creates a list of RowItems that are marked dirty
`List<RowItem>` `getListView()` creates and returns an unmodifiable view of the embedded list
`RowItem` `getRowAt(int row)`
`int` `getRowCount()`
`Object` `getValueAt(int row, int column)`
`boolean` `isCellEditable(int row, int column)`
`boolean` `isEditable()`
`void` `refresh(List<RowItem> list)`
`void` `saveDirtyRows(Connection con)`
`void` `setEditable(boolean flag)`
`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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RowItemTableModel

    public RowItemTableModel(List<RowItem> list)

Method Detail

### refresh

    public void refresh(List<RowItem> list)

### setEditable

    public void setEditable(boolean flag)

  Specified by:
    `setEditable` in interface `EditableComponent`

### isEditable

    public boolean isEditable()

  Specified by:
    `isEditable` in interface `EditableComponent`

### getRowAt

    public RowItem getRowAt(int row)

### getListView

    public List<RowItem> getListView()

  creates and returns an unmodifiable view of the embedded list

### getDirtyRows

    public Collection<RowItem> getDirtyRows()

  creates a list of RowItems that are marked dirty

### saveDirtyRows

    public void saveDirtyRows(Connection con)
                       throws SQLException

  Throws:
    `SQLException`

### getRowCount

    public int getRowCount()

  Specified by:
    `getRowCount` in interface `TableModel`

### getColumnCount

    public int getColumnCount()

  Specified by:
    `getColumnCount` in interface `TableModel`

### getColumnName

    public String getColumnName(int column)

  Specified by:
    `getColumnName` in interface `TableModel`
  Overrides:
    `getColumnName` 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)

  Specified by:
    `getValueAt` in interface `TableModel`

### isCellEditable

    public boolean isCellEditable(int row,
                                  int column)

  Specified by:
    `isCellEditable` in interface `TableModel`
  Overrides:
    `isCellEditable` in class `AbstractTableModel`

### setValueAt

    public void setValueAt(Object value,
                           int row,
                           int column)

  Specified by:
    `setValueAt` in interface `TableModel`
  Overrides:
    `setValueAt` in class `AbstractTableModel`

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads