adams.gui.selection
Class SelectEmailAddressPanel.TableModel

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

public static class SelectEmailAddressPanel.TableModel
extends AbstractTableBasedSelectionPanel.AbstractSelectionTableModel<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
protected  List<EmailContact> m_Values
          the contacts.
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SelectEmailAddressPanel.TableModel()
          the constructor.
SelectEmailAddressPanel.TableModel(EmailContact[] contacts)
          the constructor.
SelectEmailAddressPanel.TableModel(List<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.
 EmailContact getItemAt(int row)
          Returns the item at the specified position.
 int getRowCount()
          Returns the number of contacts.
 Object getValueAt(int row, int column)
          Returns the substance value at the given position.
 int indexOf(EmailContact item)
          Returns the index of the given (visible) item, -1 if not found.
 boolean isSearchMatch(SearchParameters params, int row)
          Tests whether the search matches the specified row.
 
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
 

Field Detail

m_Values

protected List<EmailContact> m_Values
the contacts.

Constructor Detail

SelectEmailAddressPanel.TableModel

public SelectEmailAddressPanel.TableModel()
the constructor.


SelectEmailAddressPanel.TableModel

public SelectEmailAddressPanel.TableModel(List<EmailContact> contacts)
the constructor.

Parameters:
contacts - the contacts to display

SelectEmailAddressPanel.TableModel

public SelectEmailAddressPanel.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.

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
Overrides:
getColumnName in class AbstractTableModel
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
Overrides:
getColumnClass in class AbstractTableModel
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.

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.

Parameters:
params - the search parameters
row - the row of the underlying, unsorted model
Returns:
true if the search matches this row

getRowCount

public int getRowCount()
Returns the number of contacts.

Returns:
the number of contacts/rows

getItemAt

public EmailContact getItemAt(int row)
Returns the item at the specified position.

Specified by:
getItemAt in class AbstractTableBasedSelectionPanel.AbstractSelectionTableModel<EmailContact>
Parameters:
row - the (actual, not visible) position of the item
Returns:
the item at the position, null if not valid index

indexOf

public int indexOf(EmailContact item)
Returns the index of the given (visible) item, -1 if not found.

Specified by:
indexOf in class AbstractTableBasedSelectionPanel.AbstractSelectionTableModel<EmailContact>
Parameters:
item - the item to look for
Returns:
the index, -1 if not found


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