Class PResourceTableModel

All Implemented Interfaces:
Serializable, TableModel

public class PResourceTableModel extends PAbstractMonitorTableModel
This is a table model used for resource table containing the resource name, credit limit, credit floor, thresholds and the running total.
Author:
Chethana Eswarappa
See Also:
  • Constructor Details

    • PResourceTableModel

      public PResourceTableModel()
  • Method Details

    • getValueForColumn

      protected Object getValueForColumn(Object element, int columnIndex)
      Returns the cell value from the passed row data structure at columnIndex.
      Specified by:
      getValueForColumn in class PAbstractMonitorTableModel
      Parameters:
      element - Object the value for the column
      columnIndex - int the column whose value is to be queried
      e - Object the row object
      Returns:
      the value Object at the specified cell
    • getColumnName

      public String getColumnName(int col)
      Returns the name of the column at col.
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
      Parameters:
      col - int
      Returns:
      String
    • getColumnCount

      public int getColumnCount()
      Returns the number of columns in the model.
      Returns:
      int
    • setData

      public void setData(ArrayList l)
      Sets the data to the model.
      Parameters:
      l - ArrayList
    • formatTable

      protected void formatTable(PFCTable table)
      Customizing the table
      Overrides:
      formatTable in class PAbstractMonitorTableModel
      Parameters:
      table - PFCTable
    • isCellEditable

      public boolean isCellEditable(int row, int col)
      Returns true only for the credit limit and the credit floor column.
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
      Parameters:
      row - int
      col - int
      Returns:
      boolean
    • setValueAt

      public void setValueAt(Object value, int row, int column)
      This method updates the balance monitor object with the credit limit and the credit floor
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
      Parameters:
      value - Object
      row - int
      column - int