Class DataBlockTableView<T extends PamDataUnit>

java.lang.Object
PamView.component.DataBlockTableView<T>
Direct Known Subclasses:
CalibrationTableView, EffortTableView, QAOpsTable, QATestTable, RXTablePanel2

public abstract class DataBlockTableView<T extends PamDataUnit> extends Object
  • Constructor Details

    • DataBlockTableView

      public DataBlockTableView(PamDataBlock<T> pamDataBlock, String displayName)
  • Method Details

    • fireTableStructureChanged

      public void fireTableStructureChanged()
      Call the fireTableStructureChanged function for the table.
    • fireTableDataChanged

      public void fireTableDataChanged()
      Call the table data changed function to update table values.
    • getComponent

      public JComponent getComponent()
    • showViewerScrollControls

      public void showViewerScrollControls(boolean show)
      Show the scroll bar controls at the top of the display in viewer mode. The are on by default, so if you call this, it will probably be with 'false'
      Parameters:
      show - show controls
    • getTable

      public JTable getTable()
      Get table. Allows adding of more menu handlers, etc.
      Returns:
      the table object.
    • setAllowMultipleRowSelection

      public void setAllowMultipleRowSelection(boolean allow)
      Set allowing of multiple row selection.
      Parameters:
      allow -
    • getToolTipText

      public String getToolTipText(T dataUnit, int columnIndex)
      Get a tooltip for the data unit.
      Parameters:
      dataUnit - Data unit for the row the mouse is over - note that this might be null
      columnIndex - column the mouse is over.
      Returns:
      tool tip text or null
    • getColumnNames

      public abstract String[] getColumnNames()
      Returns:
      a list of column names.
    • getColumnData

      public abstract Object getColumnData(T dataUnit, int column)
      Data for a particular column extracted from the data unit.
      Parameters:
      dataUnit -
      column -
      Returns:
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      The class of the table column. Defaults to 'Object' can be overridden.
      Parameters:
      columnIndex -
      Returns:
    • getRowCount

      public int getRowCount()
      Get the number of rows in the table - default behaviour is the number of rows in the datablock, but this may be overridden if data are being selected in a different way.
      Returns:
      number of table rows to show.
    • getDataIndexForRow

      public int getDataIndexForRow(int tableRow)
      Get the absolute index of the data within the PAMDataBlock for the row in the table. Default behaviour is that in viewer mode, there is 1:1 correspondence, so data are displayed in order. In normal mode, data are displayed in reverse oder, with newest data in row 0.
      Parameters:
      tableRow -
      Returns:
    • popupMenuAction

      public void popupMenuAction(MouseEvent e, T dataUnit, String colName)
    • getMultipleSelectedRows

      public T[] getMultipleSelectedRows()
      Check for multiple row selection.

      If wanted, this should be called back from implementations of popupMenuAction

      Returns:
      Array of multiple rows selected.
    • getColumnName

      public String getColumnName(int column)
      Put the getColumnName function out here, so that subclasses can more easily override it than if it's buried in the table model
      Parameters:
      column -
      Returns:
      colum name