Class RegistryTable

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, RowSorterListener, TableColumnModelListener, TableModelListener, Scrollable

public class RegistryTable extends JTable
Specialised JTable for displaying the results of a registry query (RegResource elements). It installs specialised TableModel and TableColumnModel, so these should not be reset. It provides a number of convenience features for making sure that the column widths are and stay reasonably sensible.

The user can click the column headers to control sorting of the table. By default it is sorted on the first column; this can be reset programmatically using setSorting(int, boolean).

Since:
21 Dec 2004
Author:
Mark Taylor (Starlink)
See Also:
  • Constructor Details

    • RegistryTable

      public RegistryTable()
      Constructs a new table with a default table model.
    • RegistryTable

      public RegistryTable(ResourceTableModel tModel)
      Constructs a new table with a supplied table model.
      Parameters:
      tModel - table model for display of registry resources
  • Method Details

    • setData

      public void setData(RegResource[] data)
      Sets the list of resources displayed by this table.
      Parameters:
      data - table data
    • getData

      public RegResource[] getData()
      Returns the list of resources displayed by this table.
      Returns:
      table data
    • getMetaColumnModel

      public MetaColumnModel getMetaColumnModel()
      Returns the MetaColumnModel used for this table. This allows column reinsertion as well as deletion.
      Returns:
      column model
    • setSorting

      public void setSorting(int icol, boolean descending)
      Configures how resource sorting will be done.
      Parameters:
      icol - column for sort key
      descending - false for sort up; true for sort down