com.valhalla.jbother
Class ServiceTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended bycom.valhalla.jbother.ServiceTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

class ServiceTableModel
extends javax.swing.table.AbstractTableModel

The table model for the ServiceDiscoveryDialog table

Version:
1.0
Author:
Adam Olsen

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
ServiceTableModel(ServiceDiscoveryDialog dialog)
          Default Constructor
 
Method Summary
 void addItem(java.lang.String[] item)
          Adds a row to the table
 void clear()
          Clears the table
 int getColumnCount()
          gets the number of columns in this table
 java.lang.String getColumnName(int column)
          Returns the name of a specific column
 java.lang.String getFeatures(int row)
          gets the features of a specific item (row)
 int getRowCount()
          Gets the number of rows in the table
 java.lang.Object getValueAt(int row, int column)
          Get the Object for a specific coordinate in the table
 void setDisco(int index, org.jivesoftware.smackx.packet.DiscoverInfo disco)
          Sets the disco information once it's found
 void setItemInfo(int row, java.lang.String name, java.lang.String category)
          Sets information about a specific row
 void setTable(javax.swing.JTable table)
          Sets the table value for this model
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ServiceTableModel

public ServiceTableModel(ServiceDiscoveryDialog dialog)
Default Constructor

Parameters:
dialog - the ServiceDiscoveryDialog that contains this table
Method Detail

setTable

public void setTable(javax.swing.JTable table)
Sets the table value for this model

Parameters:
table - the table that this model represents

getColumnCount

public int getColumnCount()
gets the number of columns in this table

Returns:
the number of columns

getRowCount

public int getRowCount()
Gets the number of rows in the table

Returns:
the number of rows in the table

getColumnName

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

Parameters:
column - the column who's name is wanted
Returns:
the name of the column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int column)
Get the Object for a specific coordinate in the table

Parameters:
row - the row of the item
column - the column of the item
Returns:
the Object at the specified coordinates

getFeatures

public java.lang.String getFeatures(int row)
gets the features of a specific item (row)

Parameters:
row - the index of the row you want information for
Returns:
a string containing all of the features the row supports

setDisco

public void setDisco(int index,
                     org.jivesoftware.smackx.packet.DiscoverInfo disco)
Sets the disco information once it's found

Parameters:
index - the index of the row you want to set the information about
disco - the information about the row

addItem

public void addItem(java.lang.String[] item)
Adds a row to the table

Parameters:
item - the array containing the item to add

setItemInfo

public void setItemInfo(int row,
                        java.lang.String name,
                        java.lang.String category)
Sets information about a specific row

Parameters:
row - the row to set
name - the new name
category - the category of the row

clear

public void clear()
Clears the table