Class GhidraTable

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

public class GhidraTable extends GTable
Navigation is only supported if the underlying table model implements ProgramTableModel and the setGoToService() method has been called with a valid reference. When both of these conditions are met, then the table will navigate on a user's double-click or on an Enter key press. Also, if selection navigation is enabled, then this table will navigate any time the selection of the table changes. To prevent this feature call setNavigateOnSelectionEnabled(boolean) with a value of false.

See Also:
  • Constructor Details

    • GhidraTable

      public GhidraTable()
    • GhidraTable

      public GhidraTable(TableModel model)
  • Method Details

    • initDefaultRenderers

      protected void initDefaultRenderers()
      Installs the default TableCellRenderers for known Ghidra table cell data classes. Subclasses can override this method to add additional types or to change the default associations.
      Overrides:
      initDefaultRenderers in class GTable
    • installNavigation

      public void installNavigation(GoToService goToService, Navigatable nav)
      Sets the GoTo service to use when navigation is enabled on this table.
      Parameters:
      goToService - the GoTo service.
      nav - the navigable
    • removeNavigation

      public void removeNavigation()
    • getProgramSelection

      public ProgramSelection getProgramSelection()
      Returns the program selection equivalent to the rows currently selected in the table. This method is only valid when the underlying table model implements ProgramTableModel.

      Returns null if no rows are selected or the underlying model does not implement ProgramTableModel.

      Returns:
      the program selection or null.
    • getProgram

      public Program getProgram()
      Returns the program being used by this table; null if the underlying model does not implement ProgramTableModel
      Returns:
      the table's program
    • setNavigateOnSelectionEnabled

      public void setNavigateOnSelectionEnabled(boolean enabled)
      Allows the user to enable and disable the table's feature that triggers navigation on certain selection events, like mouse clicking and pressing the 'Enter' key.
      Parameters:
      enabled - true enables the navigation on selection feature.
    • setValueAt

      public void setValueAt(Object aValue, int row, int column)
      Overrides:
      setValueAt in class JTable
    • selectRow

      public void selectRow(int row)
      Selects the given row and performs a goto, if applicable.
      Overrides:
      selectRow in class GTable
      Parameters:
      row - The row to select
    • dispose

      public void dispose()
      Description copied from class: GTable
      Call this when the table will no longer be used
      Overrides:
      dispose in class GTable