adams.gui.tools
Class EmailAddressBookPanel.TableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by adams.gui.core.AbstractBaseTableModel
          extended by adams.gui.selection.AbstractTableBasedSelectionPanel.AbstractSelectionTableModel<T>
              extended by adams.gui.tools.AbstractManagementTableModel<EmailContact>
                  extended by adams.gui.tools.EmailAddressBookPanel.TableModel
All Implemented Interfaces:
SpreadSheetSupporter, ClearableModel, CustomSearchTableModel, Serializable, TableModel
Enclosing class:
EmailAddressBookPanel

public static class EmailAddressBookPanel.TableModel
extends AbstractManagementTableModel<EmailContact>

A simple table model for displaying the contacts.

Version:
$Revision: 6908 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
 
Fields inherited from class adams.gui.tools.AbstractManagementTableModel
m_Values
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
EmailAddressBookPanel.TableModel()
          the constructor.
EmailAddressBookPanel.TableModel(EmailContact[] contacts)
          the constructor.
EmailAddressBookPanel.TableModel(Vector<EmailContact> contacts)
          the constructor.
 
Method Summary
 Class getColumnClass(int columnIndex)
          Returns the class type of the column.
 int getColumnCount()
          Returns the number of columns in the table, i.e., 6.
 String getColumnName(int column)
          Returns the name of the column.
 Object getValueAt(int row, int column)
          Returns the substance value at the given position.
 boolean isSearchMatch(SearchParameters params, int row)
          Tests whether the search matches the specified row.
 
Methods inherited from class adams.gui.tools.AbstractManagementTableModel
add, addAll, clear, getItemAt, getRowCount, indexOf
 
Methods inherited from class adams.gui.core.AbstractBaseTableModel
toSpreadSheet, toString
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, isCellEditable, removeTableModelListener, setValueAt
 

Constructor Detail

EmailAddressBookPanel.TableModel

public EmailAddressBookPanel.TableModel()
the constructor.


EmailAddressBookPanel.TableModel

public EmailAddressBookPanel.TableModel(Vector<EmailContact> contacts)
the constructor.

Parameters:
contacts - the contacts to display

EmailAddressBookPanel.TableModel

public EmailAddressBookPanel.TableModel(EmailContact[] contacts)
the constructor.

Parameters:
contacts - the contacts to display
Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns in the table, i.e., 6.

Specified by:
getColumnCount in interface TableModel
Specified by:
getColumnCount in class AbstractManagementTableModel<EmailContact>
Returns:
the number of columns, always 6

getColumnName

public String getColumnName(int column)
Returns the name of the column.

Specified by:
getColumnName in interface TableModel
Specified by:
getColumnName in class AbstractManagementTableModel<EmailContact>
Parameters:
column - the column to get the name for
Returns:
the name of the column

getColumnClass

public Class getColumnClass(int columnIndex)
Returns the class type of the column.

Specified by:
getColumnClass in interface TableModel
Specified by:
getColumnClass in class AbstractManagementTableModel<EmailContact>
Parameters:
columnIndex - the column to get the class for
Returns:
the class for the column

getValueAt

public Object getValueAt(int row,
                         int column)
Returns the substance value at the given position.

Specified by:
getValueAt in interface TableModel
Specified by:
getValueAt in class AbstractManagementTableModel<EmailContact>
Parameters:
row - the row
column - the column (ignored, since only 1 column)
Returns:
the value

isSearchMatch

public boolean isSearchMatch(SearchParameters params,
                             int row)
Tests whether the search matches the specified row.

Specified by:
isSearchMatch in interface CustomSearchTableModel
Specified by:
isSearchMatch in class AbstractManagementTableModel<EmailContact>
Parameters:
params - the search parameters
row - the row of the underlying, unsorted model
Returns:
true if the search matches this row


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.