Class PathnameTablePanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class PathnameTablePanel extends JPanel
Component that has a table to show pathnames; the panel includes buttons to control the order of the paths, and to add and remove paths. The add button brings up a file chooser. Call the setFileChooser() method to control how the file chooser should behave. If the table entries should not be edited, call setEditingEnabled(false).
See Also:
  • Constructor Details

    • PathnameTablePanel

      public PathnameTablePanel(String[] paths, boolean enableEdits, boolean addToTop)
      Construct a new PathnameTablePanel.
      Parameters:
      paths - list of paths to show; may be null
      enableEdits - true if edits should be allowed
      addToTop - true if new paths are to be added to the top of the table, false if new paths are to be added to the end of the table
    • PathnameTablePanel

      public PathnameTablePanel(String[] paths, boolean enableEdits, boolean addToTop, Callback resetCallback)
      Construct a new PathnameTablePanel will a reset button
      Parameters:
      paths - list of paths to show; may be null
      enableEdits - true if edits should be allowed
      addToTop - true if new paths are to be added to the top of the table, false
      resetCallback - Callback containing the action to perform if the reset button is pressed if new paths are to be added to the end of the table
  • Method Details

    • setFileChooserProperties

      public void setFileChooserProperties(String title, String preferenceForLastSelectedDir, GhidraFileChooserMode selectionMode, boolean allowMultiSelection, GhidraFileFilter filter)
      Set properties on the file chooser that is displayed when the "Add" button is pressed.
      Parameters:
      title - title of the file chooser
      preferenceForLastSelectedDir - Preference to use as the current directory in the file chooser
      selectionMode - mode defined in GhidraFileFilter, e.g., GhidraFileFilter.FILES_ONLY
      allowMultiSelection - true if multiple files can be selected
      filter - filter to use; may be null if no filtering is required
    • setEditingEnabled

      public void setEditingEnabled(boolean enableEdits)
      Set whether the entries in the table can be edited.
      Parameters:
      enableEdits - false means to not allow editing; the table is editable by default.
    • setAddToTop

      public void setAddToTop(boolean addToTop)
      Set whether new paths should be added to the top of the table (true) or at the end of the table (false).
      Parameters:
      addToTop - true means to add to the top of the table
    • getPaths

      public String[] getPaths()
      Return paths in the table.
    • setPaths

      public void setPaths(String[] paths)
      Set the paths.
    • getTable

      public JTable getTable()
      Get the table in this path name panel.
    • clear

      public void clear()
      Clear the paths in the table.