Arch4J 1.1

org.arch4j.ui.table
Class ObjectSelectionTableModel

java.lang.Object
  |
  +--javax.swing.table.AbstractTableModel
        |
        +--javax.swing.table.DefaultTableModel
              |
              +--org.arch4j.ui.table.ObjectTableModel
                    |
                    +--org.arch4j.ui.table.ObjectSelectionTableModel
All Implemented Interfaces:
Serializable, TableModel

public class ObjectSelectionTableModel
extends ObjectTableModel

This is the table model to support the selection of objects table.

Author:
Allan Wick
See Also:
ObjectSelectionTable, 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
ObjectSelectionTableModel(Collection anObjectList, Collection anAccessorList, Collection aColumnHeadingList, Collection aRowHeadingList)
          Creates a new instance of ObjectTableModel
 
Method Summary
 void addSelectedObject(Object anObject)
          Add a object to the selected object list.
 void clearSelections()
          Deselect all items.
 Class getColumnClass(int c)
          JTable uses this method to determine the default renderer/ editor for each cell.
protected  Vector getRowData(Object anObject)
          Get the data for an object.
 Collection getSelectedObjects()
          Get the selected objects from the table.
 void refreshTableData(Object anObject)
          Refresh the row data for the given object.
 void selectAllObjects()
          Sets all items as selected
 void setValueAt(Object aValue, int aRow, int aColumn)
          Set the value to the object for the the given row and column.
 
Methods inherited from class org.arch4j.ui.table.ObjectTableModel
addObject, addRowFor, getIndex, getObjects, getRowObject, getSelectionMode, refreshTableData, removeAllRows, removeObject, setObjects, setSelectionMode
 
Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, isCellEditable, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
 
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

ObjectSelectionTableModel

public ObjectSelectionTableModel(Collection anObjectList,
                                 Collection anAccessorList,
                                 Collection aColumnHeadingList,
                                 Collection aRowHeadingList)
Creates a new instance of ObjectTableModel

Method Detail

getRowData

protected Vector getRowData(Object anObject)
Get the data for an object.

Overrides:
getRowData in class ObjectTableModel
Parameters:
anObject - The object to get the data for.

getColumnClass

public Class getColumnClass(int c)
JTable uses this method to determine the default renderer/ editor for each cell. If we didn't implement this method, then the last column would contain text ("true"/"false"), rather than a check box.

Specified by:
getColumnClass in interface TableModel
Overrides:
getColumnClass in class AbstractTableModel

setValueAt

public void setValueAt(Object aValue,
                       int aRow,
                       int aColumn)
Set the value to the object for the the given row and column.

Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class DefaultTableModel
Parameters:
aValue - The value for the row/column.
aRow - The row to put the value in..
aColumn - The column in the row to put the object in.

refreshTableData

public void refreshTableData(Object anObject)
Refresh the row data for the given object.

Overrides:
refreshTableData in class ObjectTableModel
Parameters:
anObject - The object to update the data for.

getSelectedObjects

public Collection getSelectedObjects()
Get the selected objects from the table.

Returns:
The selected objects from the table.

addSelectedObject

public void addSelectedObject(Object anObject)
Add a object to the selected object list.

Parameters:
anObject - The object to add.

selectAllObjects

public void selectAllObjects()
Sets all items as selected


clearSelections

public void clearSelections()
Deselect all items.


Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.