com.valhalla.pluginmanager
Class PluginTableModel

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

class PluginTableModel
extends javax.swing.table.AbstractTableModel

Represents a list of plugins in a table

Version:
1.0
Author:
Adam Olsen

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
(package private) PluginTableModel(PluginManagerPanel panel)
          Sets up the list model
 
Method Summary
 java.lang.Class getColumnClass(int index)
          Gets the column class
 int getColumnCount()
           
 java.lang.String getColumnName(int index)
          Returns the column name for a specified index
 java.lang.String getDescription(int index)
          Gets a description for a plugin
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int column)
          Get the Object for a specific coordinate in the table
 boolean isCellEditable(int row, int column)
          Finds out whether or not a cell is editable
 void setManageModel()
          Sets up the list model as a manage panel
 void setPlugins(java.util.ArrayList list)
          Sets the list of plugins in the Table
 void setTable(javax.swing.JTable table)
          Sets the table value for this model
 void setValueAt(java.lang.Object value, int row, int col)
          Fired when the tables data is changed
 
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

PluginTableModel

PluginTableModel(PluginManagerPanel panel)
Sets up the list model

Parameters:
panel - the PluginManagerListPanel that encloses this model's table
Method Detail

setManageModel

public void setManageModel()
Sets up the list model as a manage panel


isCellEditable

public boolean isCellEditable(int row,
                              int column)
Finds out whether or not a cell is editable

Parameters:
row - the row to check
column - the column to check
Returns:
true if the cell is editable

setValueAt

public void setValueAt(java.lang.Object value,
                       int row,
                       int col)
Fired when the tables data is changed

Parameters:
value - the new value of the data
row - the row of the item
col - the column of the item

getDescription

public java.lang.String getDescription(int index)
Gets a description for a plugin

Parameters:
index - the index of plugin to get the description of
Returns:
a description of the plugin

setPlugins

public void setPlugins(java.util.ArrayList list)
Sets the list of plugins in the Table

Parameters:
list - the list of plugins

setTable

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

Parameters:
table - the table that this model represents

getColumnName

public java.lang.String getColumnName(int index)
Returns the column name for a specified index

Parameters:
index - the index you want
Returns:
the column name

getColumnClass

public java.lang.Class getColumnClass(int index)
Gets the column class

Parameters:
index - the column index to return
Returns:
the Class that represents the column

getColumnCount

public int getColumnCount()
Returns:
the number of columns in the table

getRowCount

public int getRowCount()
Returns:
the number of rows in the table

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