org.jacorb.imr.util
Class ImRServerTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byorg.jacorb.imr.util.ImRServerTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class ImRServerTableModel
extends javax.swing.table.AbstractTableModel

This class is the model for the server table. On user changes, it writes back its edited cells via the IMRModel class.

Author:
Nicolas Noffke $Id: ImRServerTableModel.java,v 1.6 2002/12/20 18:29:04 nicolas Exp $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ImRServerTableModel(ImRModel model)
          The constructor.
 
Method Summary
 java.lang.Class getColumnClass(int index)
          Get the class of a specific column.
 int getColumnCount()
          Get the number of columns of this table.
 java.lang.String getColumnName(int column)
          Get the name of a specific column.
 int getRowCount()
          Get the number of rows of this table.
 java.lang.Object getValueAt(int row, int column)
          Get the value of a specific cell.
 boolean isCellEditable(int row, int column)
          Test, wheter a cell is editable.
 void serverRefreshed(int index)
          Notify the JTable that a server has been updated.
 void setServers(ServerInfo[] servers)
          Pass in the servers the table should display.
 void setValueAt(java.lang.Object value, int row, int column)
          Set the value of a specific cell, i.e. the user has edited a cell.
 
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

ImRServerTableModel

public ImRServerTableModel(ImRModel model)
The constructor.

Parameters:
model - the ImRModel to write changes via.
Method Detail

setServers

public void setServers(ServerInfo[] servers)
Pass in the servers the table should display. Notify the JTable of that.

Parameters:
servers - an array containing the ServerInfo structs of the servers to display.

serverRefreshed

public void serverRefreshed(int index)
Notify the JTable that a server has been updated.

Parameters:
index - the servers index in the table.

getRowCount

public int getRowCount()
Get the number of rows of this table.

Returns:
the number of rows.

getColumnCount

public int getColumnCount()
Get the number of columns of this table.

Returns:
the number of columns.

getColumnName

public java.lang.String getColumnName(int column)
Get the name of a specific column.

Returns:
String the columns name.

getColumnClass

public java.lang.Class getColumnClass(int index)
Get the class of a specific column.

Parameters:
index - the columns index.
Returns:
the columns Class object.

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Get the value of a specific cell.

Parameters:
row - the cells row.
column - the cells column.
Returns:
the cells value.

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Test, wheter a cell is editable.

Parameters:
row - the cells row.
column - the cells column.
Returns:
true, if the cell is editable.

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int column)
Set the value of a specific cell, i.e. the user has edited a cell.

Parameters:
value - the new value.
row - the cells row.
column - the cells column.