public class ListWrappingTableModel extends javax.swing.table.AbstractTableModel implements ItemRemovable
Constructor and Description |
---|
ListWrappingTableModel(java.util.List<java.util.List<java.lang.String>> list,
java.lang.String... columnNames) |
ListWrappingTableModel(java.util.List<java.lang.String> list,
java.lang.String columnName)
Constructor to create a single column model.
|
Modifier and Type | Method and Description |
---|---|
void |
addRow() |
void |
addRow(java.lang.String... values) |
java.lang.Class<java.lang.String> |
getColumnClass(int columnIndex) |
int |
getColumnCount() |
java.lang.String |
getColumnName(int columnIndex) |
int |
getRowCount() |
java.lang.Object |
getValueAt(int rowIndex,
int columnIndex) |
int |
indexOf(java.lang.String value,
int columnIndex) |
boolean |
isCellEditable(int rowIndex,
int columnIndex) |
void |
removeRow(int rowIndex)
Remove row with index
idx and fire DELETE event (e.g. |
void |
setValueAt(java.lang.Object value,
int rowIndex,
int columnIndex) |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
public ListWrappingTableModel(java.util.List<java.util.List<java.lang.String>> list, java.lang.String... columnNames)
public ListWrappingTableModel(java.util.List<java.lang.String> list, java.lang.String columnName)
list
- the rows of the tablecolumnName
- the name in the column headerpublic void addRow(java.lang.String... values)
public void addRow()
public java.lang.Class<java.lang.String> getColumnClass(int columnIndex)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
public int getColumnCount()
getColumnCount
in interface javax.swing.table.TableModel
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
public int getRowCount()
getRowCount
in interface javax.swing.table.TableModel
public java.lang.Object getValueAt(int rowIndex, int columnIndex)
getValueAt
in interface javax.swing.table.TableModel
public int indexOf(java.lang.String value, int columnIndex)
public boolean isCellEditable(int rowIndex, int columnIndex)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
public void removeRow(int rowIndex)
ItemRemovable
idx
and fire DELETE
event (e.g. by calling
AbstractTableModel.fireTableRowsDeleted(int, int)
)removeRow
in interface ItemRemovable
public void setValueAt(java.lang.Object value, int rowIndex, int columnIndex)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel