DESY ACOP Beans Home

com.cosylab.gui.components.table
Class MutableTableModelRows

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by com.cosylab.gui.components.table.TableModelRows
          extended by com.cosylab.gui.components.table.MutableTableModelRows
All Implemented Interfaces:
TableRowModelListener, java.io.Serializable, javax.swing.table.TableModel
Direct Known Subclasses:
ObjectTableModel

public class MutableTableModelRows
extends TableModelRows

MutableTableModelRows is implementation of TableModelRows which acts as mutable TabmeRowModel in the same time. User can set this model to JTable and then add or remove rows directly from this model.

Since:
May 4, 2004.
Version:
$Id: MutableTableModelRows.java,v 1.5 2008-04-22 12:28:40 jbobnar Exp $
Author:
Igor Kriznar
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
MutableTableModelRows()
          Creates new instance.
 
Method Summary
 void addRow(int index, TableRow row)
          Inserts row at the specified index.
 void addRow(TableRow row)
          Adds row to the end of the row list.
 java.util.Comparator getComparator()
           
 TableRow getRow(int index)
          Returns row at given index,
 void removeAllRows()
          Removes all rows from this model.
 TableRow removeRow(int index)
          Removes row from this model.
 void removeRow(TableRow row)
          Removes row from this model.
 void setColumnCount(int count)
          Sets the number of columns this model presents.
 void setColumnNames(java.lang.String[] names)
          Sets column names.
 void setComparator(java.util.Comparator comparator)
           
 
Methods inherited from class com.cosylab.gui.components.table.TableModelRows
getColumnCount, getColumnName, getRowCount, getRowModel, getValueAt, isCellEditable, tableChanged
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MutableTableModelRows

public MutableTableModelRows()
Creates new instance.

Method Detail

addRow

public void addRow(int index,
                   TableRow row)
Inserts row at the specified index.

Parameters:
index - the index where to insert
row - the row to be added

addRow

public void addRow(TableRow row)
Adds row to the end of the row list.

Parameters:
row - the row to be added

getRow

public TableRow getRow(int index)
Returns row at given index,

Parameters:
index - the index of the row
Returns:
the row at the specified index

removeAllRows

public void removeAllRows()
Removes all rows from this model.


removeRow

public TableRow removeRow(int index)
Removes row from this model.

Parameters:
index - rowindex to be roemoved
Returns:
the removed row

removeRow

public void removeRow(TableRow row)
Removes row from this model.

Parameters:
row - the row to be removed

setColumnCount

public void setColumnCount(int count)
Sets the number of columns this model presents.

Parameters:
count - the number of columns

setColumnNames

public void setColumnNames(java.lang.String[] names)
Sets column names.

Parameters:
names - the column names

getComparator

public java.util.Comparator getComparator()
Returns:
the comparator

setComparator

public void setComparator(java.util.Comparator comparator)
Parameters:
comparator - the comparator to set


Copyright © 2010. All Rights Reserved.