JIDE 3.5.15

com.jidesoft.grid
Class DefaultUndoableTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by javax.swing.table.DefaultTableModel
          extended by com.jidesoft.grid.DefaultUndoableTableModel
All Implemented Interfaces:
TableUndoableSupport, UndoableSupport, Serializable, TableModel

public class DefaultUndoableTableModel
extends DefaultTableModel
implements TableUndoableSupport

Default undoable TableModel that implements TableUndoableSupport over DefaultTableModel.

Since:
3.3.4
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DefaultUndoableTableModel()
           
DefaultUndoableTableModel(int rowCount, int columnCount)
           
DefaultUndoableTableModel(Object[][] data, Object[] columnNames)
           
DefaultUndoableTableModel(Object[] columnNames, int rowCount)
           
DefaultUndoableTableModel(Vector columnNames, int rowCount)
           
DefaultUndoableTableModel(Vector data, Vector columnNames)
           
 
Method Summary
 void beginCompoundEdit(boolean isUndoRedo)
          Begins the edit of the model.
 void endCompoundEdit()
          Ends the edit of the model.
 void fireTableChanged(TableModelEvent e)
           
 UndoableEditSupport getUndoableEditSupport()
          Gets the UndoableEditSupport instance to add UndoableListener.
 UndoManager getUndoManager()
          Gets the UndoManager.
 void insertRow(int row, Vector rowData)
           
 void removeRow(int row)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void undoableInsertRow(int row, Vector<Object> rowData)
          Inserts a row at the designated row index.
 void undoableRemoveRow(int row)
          Removes a row at the designated row index.
 void undoableUpdateCell(int row, int column, Object value)
          Updates a cell at the designated cell with the new cell data .
 void undoableUpdateRow(int rowIndex, Vector<Object> rowData)
          Updates a row at the designated row index with the new row data .
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultUndoableTableModel

public DefaultUndoableTableModel()

DefaultUndoableTableModel

public DefaultUndoableTableModel(int rowCount,
                                 int columnCount)

DefaultUndoableTableModel

public DefaultUndoableTableModel(Vector columnNames,
                                 int rowCount)

DefaultUndoableTableModel

public DefaultUndoableTableModel(Object[] columnNames,
                                 int rowCount)

DefaultUndoableTableModel

public DefaultUndoableTableModel(Vector data,
                                 Vector columnNames)

DefaultUndoableTableModel

public DefaultUndoableTableModel(Object[][] data,
                                 Object[] columnNames)
Method Detail

getUndoManager

public UndoManager getUndoManager()
Description copied from interface: UndoableSupport
Gets the UndoManager.

Specified by:
getUndoManager in interface UndoableSupport
Returns:
the UndoManager.

getUndoableEditSupport

public UndoableEditSupport getUndoableEditSupport()
Description copied from interface: UndoableSupport
Gets the UndoableEditSupport instance to add UndoableListener.

Specified by:
getUndoableEditSupport in interface UndoableSupport
Returns:
the UndoableEditSupport instance.

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class DefaultTableModel

insertRow

public void insertRow(int row,
                      Vector rowData)
Overrides:
insertRow in class DefaultTableModel

removeRow

public void removeRow(int row)
Overrides:
removeRow in class DefaultTableModel

fireTableChanged

public void fireTableChanged(TableModelEvent e)
Overrides:
fireTableChanged in class AbstractTableModel

beginCompoundEdit

public void beginCompoundEdit(boolean isUndoRedo)
Description copied from interface: UndoableSupport
Begins the edit of the model.

Specified by:
beginCompoundEdit in interface UndoableSupport
Parameters:
isUndoRedo - the flag to indicate if this operation is triggered by undo/redo

endCompoundEdit

public void endCompoundEdit()
Description copied from interface: UndoableSupport
Ends the edit of the model.

Specified by:
endCompoundEdit in interface UndoableSupport

undoableInsertRow

public void undoableInsertRow(int row,
                              Vector<Object> rowData)
Description copied from interface: TableUndoableSupport
Inserts a row at the designated row index.

Invoking this method will be able to insert a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableInsertRow in interface TableUndoableSupport
Parameters:
row - the row index
rowData - the row data

undoableUpdateRow

public void undoableUpdateRow(int rowIndex,
                              Vector<Object> rowData)
Description copied from interface: TableUndoableSupport
Updates a row at the designated row index with the new row data .

Invoking this method will be able to update a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableUpdateRow in interface TableUndoableSupport
Parameters:
rowIndex - the row index
rowData - the row data

undoableRemoveRow

public void undoableRemoveRow(int row)
Description copied from interface: TableUndoableSupport
Removes a row at the designated row index.

Invoking this method will be able to remove a row, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableRemoveRow in interface TableUndoableSupport
Parameters:
row - the row index

undoableUpdateCell

public void undoableUpdateCell(int row,
                               int column,
                               Object value)
Description copied from interface: TableUndoableSupport
Updates a cell at the designated cell with the new cell data .

Invoking this method will be able to update a cell, then adds an UndoableEdit or fires an event if necessary.

Specified by:
undoableUpdateCell in interface TableUndoableSupport
Parameters:
row - the row index
column - the row index
value - the cell value

JIDE 3.5.15