dsto.dfc.swing.table
Interface DfcTableModel

All Superinterfaces:
TableModel
All Known Implementing Classes:
AbstractDfcTableModel, DefaultDfcTableModel, MapTableModel, ProxyTableModel, SortedTableModel, StyleSheetTableModel

public interface DfcTableModel
extends TableModel

Extension of JFC TableModel to support structural modification to rows/columns and copy/paste of data.

Version:
$Revision$

Method Summary
 boolean canCopyCells(int startRow, int endRow, int startColumn, int endColumn)
          Test if a copyCells () operation is permitted.
 boolean canCopyRows(int startRow, int endRow)
           
 boolean canDeleteCells(int startRow, int endRow, int startColumn, int endColumn)
          Test if a deleteCells () operation is permitted.
 boolean canDeleteColumns(int startColumn, int endColumn)
          Test if a deleteColumns () operation is supported.
 boolean canDeleteRows(int startRow, int endRow)
          Test if a deleteRows () operation is supported.
 boolean canInsertColumn(int columnIndex, String columnName, Class columnClass)
          Test if an insertColumn () operation is supported.
 boolean canInsertRows(int startRow, int rowCount)
          Test if an insertRows () operation is supported.
 boolean canMoveRows(int startRow, int endRow, int newStartRow)
           
 boolean canPasteCells(Transferable transferable, int startRow, int endRow, int startColumn, int endColumn)
          Should return true if rows may be pasted from a given Transferable into a block of cells.
 boolean canPasteRows(Transferable transferable, int startRow)
          Should return true if rows may be pasted from a given Transferable at the given row.
 Transferable copyCells(int startRow, int endRow, int startColumn, int endColumn)
          Copy a rectangular block of cells into an AWT Transferable.
 Transferable copyRows(int startRow, int endRow)
           
 void deleteCells(int startRow, int endRow, int startColumn, int endColumn)
          Delete a rectangular block of cells.
 void deleteColumns(int startColumn, int endColumn)
          Delete columns.
 void deleteRows(int startRow, int endRow)
          Delete rows.
 void insertColumn(int columnIndex, String columnName, Class columnClass)
          Insert a new column containing blank values.
 void insertRows(int startRow, int rowCount)
          Insert empty rows.
 boolean moveRows(int startRow, int endRow, int newStartRow)
           
 void pasteCells(Transferable transferable, int startRow, int endRow, int startColumn, int endColumn)
           
 void pasteRows(Transferable transferable, int startRow)
           
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 

Method Detail

canInsertRows

boolean canInsertRows(int startRow,
                      int rowCount)
Test if an insertRows () operation is supported.

Parameters:
startRow - The row to begin inserting.
rowCount - The number of rows to insert.
Returns:
True if the insert is possible.

insertRows

void insertRows(int startRow,
                int rowCount)
                throws UnsupportedOperationException
Insert empty rows.

Parameters:
startRow - The row to begin inserting.
rowCount - The number of rows to insert.
Throws:
UnsupportedOperationException - if this is not supported.
See Also:
canInsertRows(int, int)

canDeleteRows

boolean canDeleteRows(int startRow,
                      int endRow)
Test if a deleteRows () operation is supported.

Parameters:
startRow - The row to begin inserting.
endRow - The last row to delete.
Returns:
True if the delete is possible.

deleteRows

void deleteRows(int startRow,
                int endRow)
                throws UnsupportedOperationException
Delete rows.

Parameters:
startRow - The row to begin inserting.
endRow - The last row to delete.
Throws:
UnsupportedOperationException - if this is not supported.
See Also:
canDeleteRows(int, int)

canMoveRows

boolean canMoveRows(int startRow,
                    int endRow,
                    int newStartRow)

moveRows

boolean moveRows(int startRow,
                 int endRow,
                 int newStartRow)
                 throws UnsupportedOperationException
Throws:
UnsupportedOperationException

canInsertColumn

boolean canInsertColumn(int columnIndex,
                        String columnName,
                        Class columnClass)
Test if an insertColumn () operation is supported.

Parameters:
columnIndex - The index for the new column.
columnName - The name of the new column. May be null to indicate automatic name.
columnClass - The class of values in the column.
Returns:
True if the insert is possible.

canDeleteColumns

boolean canDeleteColumns(int startColumn,
                         int endColumn)
Test if a deleteColumns () operation is supported.

Parameters:
startColumn - The index of the first column.
endColumn - The index of the last column.
Returns:
True if the delete is possible.

insertColumn

void insertColumn(int columnIndex,
                  String columnName,
                  Class columnClass)
                  throws UnsupportedOperationException
Insert a new column containing blank values.

Parameters:
columnIndex - The index for the new column.
columnName - The name of the new column. May be null to indicate automatic name.
columnClass - The class of values in the column.
Throws:
UnsupportedOperationException
See Also:
canInsertColumn(int, java.lang.String, java.lang.Class)

deleteColumns

void deleteColumns(int startColumn,
                   int endColumn)
                   throws UnsupportedOperationException
Delete columns.

Parameters:
startColumn - The index of the first column.
endColumn - The index of the last column.
Throws:
UnsupportedOperationException
See Also:
canDeleteColumns(int, int)

canDeleteCells

boolean canDeleteCells(int startRow,
                       int endRow,
                       int startColumn,
                       int endColumn)
Test if a deleteCells () operation is permitted.

Parameters:
startRow - The first row to delete.
endRow - The last row to delete.
startColumn - The first column to delete.
endColumn - The last column to delete.
Returns:
True if the operation is permitted.

deleteCells

void deleteCells(int startRow,
                 int endRow,
                 int startColumn,
                 int endColumn)
                 throws UnsupportedOperationException
Delete a rectangular block of cells. The deleted cells should be reset to their default values.

Parameters:
startRow - The first row to delete.
endRow - The last row to delete.
startColumn - The first column to delete.
endColumn - The last column to delete.
Throws:
UnsupportedOperationException
See Also:
canDeleteCells(int, int, int, int)

canCopyRows

boolean canCopyRows(int startRow,
                    int endRow)

copyRows

Transferable copyRows(int startRow,
                      int endRow)
                      throws UnsupportedOperationException,
                             CloneNotSupportedException
Throws:
UnsupportedOperationException
CloneNotSupportedException

canPasteRows

boolean canPasteRows(Transferable transferable,
                     int startRow)
Should return true if rows may be pasted from a given Transferable at the given row. Note that the data in the transferable may not be accessible at this time (eg during a drap and drop operation): calling getTransferData () will result in an IOException.

Parameters:
transferable - The transferable.
startRow - The row to insert the transferable at.
Returns:
True if the transferable can be pasted at startRow.

pasteRows

void pasteRows(Transferable transferable,
               int startRow)
               throws UnsupportedOperationException,
                      UnsupportedFlavorException,
                      CloneNotSupportedException,
                      IOException
Throws:
UnsupportedOperationException
UnsupportedFlavorException
CloneNotSupportedException
IOException

canCopyCells

boolean canCopyCells(int startRow,
                     int endRow,
                     int startColumn,
                     int endColumn)
Test if a copyCells () operation is permitted.

Parameters:
startRow - The first row to copy.
endRow - The last row to copy.
startColumn - The first column to copy.
endColumn - The last column to copy.
Returns:
True if the operation is permitted.

copyCells

Transferable copyCells(int startRow,
                       int endRow,
                       int startColumn,
                       int endColumn)
                       throws UnsupportedOperationException,
                              CloneNotSupportedException
Copy a rectangular block of cells into an AWT Transferable. The flavors supported by the transferable may include TableModelTransferable.TABLE_MODEL_FLAVOR but this is not required.

Parameters:
startRow - The first row to copy.
endRow - The last row to copy.
startColumn - The first column to copy.
endColumn - The last column to copy.
Throws:
CloneNotSupportedException - if a data item could not be cloned.
UnsupportedOperationException
See Also:
canCopyRows(int, int)

canPasteCells

boolean canPasteCells(Transferable transferable,
                      int startRow,
                      int endRow,
                      int startColumn,
                      int endColumn)
Should return true if rows may be pasted from a given Transferable into a block of cells. Note that the data in the transferable may not be accessible at this time (eg during a drap and drop operation): calling getTransferData () will result in an IOException in this case.

Parameters:
transferable - The transferable.
startRow - The row to insert the transferable at.
Returns:
True if the transferable can be pasted at startRow.

pasteCells

void pasteCells(Transferable transferable,
                int startRow,
                int endRow,
                int startColumn,
                int endColumn)
                throws UnsupportedOperationException,
                       UnsupportedFlavorException,
                       CloneNotSupportedException,
                       IOException
Throws:
UnsupportedOperationException
UnsupportedFlavorException
CloneNotSupportedException
IOException


Copyright © 2008 Commonwealth of Australia